File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def maybe_string(ptr):
3434 if not ptr :
3535 return None
3636
37- return ffi .string (ptr ).decode ('utf8' , errors = 'surrogateescape ' )
37+ return ffi .string (ptr ).decode ('utf8' , errors = 'replace ' )
3838
3939
4040def to_bytes (s , encoding = 'utf-8' , errors = 'strict' ):
Original file line number Diff line number Diff line change 3232
3333bstring = b'\xc3 master'
3434
35+
3536def test_nonunicode_branchname (testrepo ):
3637 folderpath = 'temp_repo_nonutf'
3738 if os .path .exists (folderpath ):
3839 shutil .rmtree (folderpath )
3940 newrepo = pygit2 .clone_repository (
40- path = folderpath ,
41- url = 'https://github.com/pygit2/test_branch_notutf.git'
42- )
41+ path = folderpath , url = 'https://github.com/pygit2/test_branch_notutf.git'
42+ )
4343 assert bstring in [
4444 (ref .split ('/' )[- 1 ]).encode ('utf8' , 'surrogateescape' )
4545 for ref in newrepo .listall_references ()
46- ] # Remote branch among references: 'refs/remotes/origin/\udcc3master'
46+ ] # Remote branch among references: 'refs/remotes/origin/\udcc3master'
You can’t perform that action at this time.
0 commit comments