Skip to content

Fix UnicodeDecodeError in diff filename #1082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

ishepard
Copy link
Contributor

@ishepard ishepard commented Nov 10, 2020

Fix for #1081.

If the filename of a diff object contained non UTF-8 chars, GitPython was raising a UnicodeDecodeError.

This PR fixes this by using the "replace" flag when decoding.
Furthermore, the variable defenc is used, that is sys.getfilesystemencoding().

@Byron Byron added this to the v3.1.12 - Bugfixes milestone Nov 10, 2020
@Byron Byron merged commit bfbd5ec into gitpython-developers:master Nov 10, 2020
@Byron Byron linked an issue Nov 10, 2020 that may be closed by this pull request
@Byron
Copy link
Member

Byron commented Nov 10, 2020

Thanks a lot for the fix, it's much appreciated!

@ishepard ishepard deleted the UDE-diff branch November 10, 2020 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

UnicodeDecodeError in diff filename
2 participants