瀏覽代碼

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 14 年之前
父節點
當前提交
2754023309
共有 1 個文件被更改,包括 1 次插入1 次删除
  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()