Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pr unicode encode error #49

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
Harmon758 merged 5 commits into gitpython-developers:master from xarx00:PR-UnicodeEncodeError
Feb 18, 2020

Conversation

Copy link
Contributor

@xarx00 xarx00 commented Apr 5, 2019
edited
Loading

This fixes the exception

Traceback (most recent call last):
 File "c:\program files\python37\lib\site-packages\gitlab\v4\bulk.py", line 429, in clone
 git.Repo.clone_from(url, wdpath)
 File "c:\program files\python37\lib\site-packages\git\repo\base.py", line 988, in clone_from
 return cls._clone(git, url, to_path, GitCmdObjectDB, progress, **kwargs)
 File "c:\program files\python37\lib\site-packages\git\repo\base.py", line 939, in _clone
 finalize_process(proc, stderr=stderr)
 File "c:\program files\python37\lib\site-packages\git\util.py", line 333, in finalize_process
 proc.wait(**kwargs)
 File "c:\program files\python37\lib\site-packages\git\cmd.py", line 402, in wait
 stderr = force_bytes(stderr)
 File "c:\program files\python37\lib\site-packages\gitdb\utils\encoding.py", line 16, in force_bytes
 return data.encode(encoding)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 29-32: ordinal not in range(128)

in git.repo.clone_from(url, path) when path contains non-ascii characters.
The stderr string being encoded contains

Cloning into 'W:\SBER\RepozitáĹTM\test/test1'...
POST git-upload-pack (237 bytes)

Very probably, this error can occur in other situations too, hence I changed the default encoding here, into the gitdb utils.

Edit: This PR is related to gitpython-developers/GitPython#761 and #48.

@Harmon758 Harmon758 merged commit 5699c13 into gitpython-developers:master Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@Harmon758 Harmon758 Harmon758 approved these changes

Assignees
No one assigned
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /