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):
34
34
if not ptr :
35
35
return None
36
36
37
- return ffi .string (ptr ).decode ('utf8' , errors = 'surrogateescape ' )
37
+ return ffi .string (ptr ).decode ('utf8' , errors = 'replace ' )
38
38
39
39
40
40
def to_bytes (s , encoding = 'utf-8' , errors = 'strict' ):
Original file line number Diff line number Diff line change 32
32
33
33
bstring = b'\xc3 master'
34
34
35
+
35
36
def test_nonunicode_branchname (testrepo ):
36
37
folderpath = 'temp_repo_nonutf'
37
38
if os .path .exists (folderpath ):
38
39
shutil .rmtree (folderpath )
39
40
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
+ )
43
43
assert bstring in [
44
44
(ref .split ('/' )[- 1 ]).encode ('utf8' , 'surrogateescape' )
45
45
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