Skip to content

Add encoding to utf-8 for fetch_info_lines, for fetch_head_info; #1325

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
Aug 24, 2021
Merged

Add encoding to utf-8 for fetch_info_lines, for fetch_head_info; #1325

merged 1 commit into from
Aug 24, 2021

Conversation

f100024
Copy link

@f100024 f100024 commented Aug 23, 2021

Fix encoding error:

UnicodeEncodeError: 'charmap' codec can't encode characters in position 39230-39231: character maps to <undefined>

Add encoding to utf-8 for fetch_head_info;
@Byron Byron added this to the v3.1.21 - Bugfixes milestone Aug 24, 2021
@Byron Byron merged commit ef1ef4d into gitpython-developers:main Aug 24, 2021
@Byron
Copy link
Member

Byron commented Aug 24, 2021

Thanks a lot for the fix.

In theory the encoding of fetch_info_lines is undefined, so it's strange that converting them into a str() works as this requires a known encoding. Especially for printing I think it's sufficient to encode with replacement instead of failure in case of encoding errors.

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.

2 participants