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

Appearance settings

Commit ebf4656

Browse filesBrowse files
ulturtByron
authored andcommitted
Fix #920
1 parent 87a103d commit ebf4656
Copy full SHA for ebf4656

2 files changed

+15-1Lines changed: 15 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/cmd.py‎

Copy file name to clipboardExpand all lines: git/cmd.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def wait(self, stderr=b''): # TODO: Bad choice to mimic `proc.wait()` but with
401401
:raise GitCommandError: if the return status is not 0"""
402402
if stderr is None:
403403
stderr = b''
404-
stderr = force_bytes(stderr)
404+
stderr = force_bytes(data=stderr, encoding='utf-8')
405405

406406
status = self.proc.wait()
407407

Collapse file

‎git/test/test_repo.py‎

Copy file name to clipboardExpand all lines: git/test/test_repo.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,20 @@ def test_clone_from_pathlib_withConfig(self, rw_dir):
245245
assert_equal(cloned.config_reader().get_value('core', 'filemode'), False)
246246
assert_equal(cloned.config_reader().get_value('submodule "repo"', 'update'), 'checkout')
247247

248+
def test_clone_from_with_path_contains_unicode(self):
249+
with tempfile.TemporaryDirectory() as tmpdir:
250+
unicode_dir_name = '\u0394'
251+
path_with_unicode = os.path.join(tmpdir, unicode_dir_name)
252+
os.makedirs(path_with_unicode)
253+
254+
try:
255+
Repo.clone_from(
256+
url=self._small_repo_url(),
257+
to_path=path_with_unicode,
258+
)
259+
except UnicodeEncodeError:
260+
self.fail('Raised UnicodeEncodeError')
261+
248262
@with_rw_repo('HEAD')
249263
def test_max_chunk_size(self, repo):
250264
class TestOutputStream(object):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.