test_repository.DiskRefsContainerTests.test_remove_packed_without_peeled: prevent...
authorTay Ray Chuan <rctay89@gmail.com>
Tue, 20 Jul 2010 17:21:09 +0000 (19:21 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 20 Jul 2010 17:21:09 +0000 (19:21 +0200)
By writing to the file in binary mode, we stop python from munging the
packed-refs file with '\r'-style line endings on Windows.

dulwich/tests/test_repository.py

index 36cb47781033d1bcc75db15f2fdc5ed65315824b..9b34d13747cbc1940281ca9c3701758f51b7f687 100644 (file)
@@ -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()