Sfoglia il codice sorgente

Support byte filenames in GitFile.

Jelmer Vernooij 7 anni fa
parent
commit
b89bedc514
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  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,