File tree Expand file tree Collapse file tree
Open diff view settings
Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ):
You can’t perform that action at this time.
0 commit comments