Explorar o código

test_repository.DiskRefsContainerTests.test_remove_packed_without_peeled: prevent '\r' on windows

By writing to the file in binary mode, we stop python from munging the
packed-refs file with '\r'-style line endings on Windows.
Tay Ray Chuan %!s(int64=14) %!d(string=hai) anos
pai
achega
2754023309
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      dulwich/tests/test_repository.py

+ 1 - 1
dulwich/tests/test_repository.py

@@ -770,7 +770,7 @@ class DiskRefsContainerTests(RefsContainerTests, TestCase):
         f = open(refs_file)
         refs_data = f.read()
         f.close()
-        f = open(refs_file, 'w')
+        f = open(refs_file, 'wb')
         f.write('\n'.join(l for l in refs_data.split('\n')
                           if not l or l[0] not in '#^'))
         f.close()