Skip to content

Commit 88f16a9

Browse files
committed
1 parent 6446608 commit 88f16a9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Diff for: git/cmd.py

+1-1
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

Diff for: git/test/test_repo.py

+14
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)