Explorar el Código

Support byte filenames in GitFile.

Jelmer Vernooij hace 7 años
padre
commit
b89bedc514
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      dulwich/file.py

+ 4 - 1
dulwich/file.py

@@ -118,7 +118,10 @@ class _GitFile(object):
 
     def __init__(self, filename, mode, bufsize):
         self._filename = filename
-        self._lockfilename = '%s.lock' % self._filename
+        if isinstance(self._filename, bytes):
+            self._lockfilename = self._filename + b'.lock'
+        else:
+            self._lockfilename = self._filename + '.lock'
         try:
             fd = os.open(
                 self._lockfilename,