2
0
Эх сурвалжийг харах

Fix os.path.sep replacement on Python3.

Jelmer Vernooij 7 жил өмнө
parent
commit
011f270d7c
1 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 3 1
      dulwich/refs.py

+ 3 - 1
dulwich/refs.py

@@ -532,7 +532,9 @@ class DiskRefsContainer(RefsContainer):
 
         """
         if os.path.sep != "/":
-            name = name.replace("/", os.path.sep)
+            name = name.replace(
+                    b"/",
+                    os.path.sep.encode(sys.getfilesystemencoding()))
         # TODO: as the 'HEAD' reference is working tree specific, it
         # should actually not be a part of RefsContainer
         if name == b'HEAD':