From: Zooko O'Whielacronx Date: Wed, 4 Apr 2007 23:12:30 +0000 (-0700) Subject: use the "binary" flag on open() for files that shouldn't have line-endings automatica... X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/%22doc.html/architecture.txt?a=commitdiff_plain;h=223bf9899236e7e585a15c621ee9012835424337;p=tahoe-lafs%2Ftahoe-lafs.git use the "binary" flag on open() for files that shouldn't have line-endings automatically converted --- diff --git a/src/allmydata/test/test_filetree_new.py b/src/allmydata/test/test_filetree_new.py index 4d478112..e1e0932a 100644 --- a/src/allmydata/test/test_filetree_new.py +++ b/src/allmydata/test/test_filetree_new.py @@ -565,7 +565,7 @@ class VDrive(unittest.TestCase): v = self.makeLocalTree("upload") filename = "upload1" DATA = "here is some data\n" - f = open(filename, "w") + f = open(filename, "wb") f.write(DATA) f.close() @@ -592,7 +592,7 @@ class VDrive(unittest.TestCase): def testCHKDirUpload(self): DATA = "here is some data\n" filename = "upload1" - f = open(filename, "w") + f = open(filename, "wb") f.write(DATA) f.close() @@ -624,7 +624,7 @@ class VDrive(unittest.TestCase): def testCHKDirDelete(self): DATA = "here is some data\n" filename = "upload1" - f = open(filename, "w") + f = open(filename, "wb") f.write(DATA) f.close() diff --git a/src/allmydata/test/test_upload.py b/src/allmydata/test/test_upload.py index 5eb9b540..dc05d766 100644 --- a/src/allmydata/test/test_upload.py +++ b/src/allmydata/test/test_upload.py @@ -43,7 +43,7 @@ class GoodServer(unittest.TestCase): def testFilename(self): fn = "Uploader-testFilename.data" - f = open(fn, "w") + f = open(fn, "wb") data = "This is some data to upload" f.write(data) f.close() diff --git a/src/allmydata/test/test_workqueue.py b/src/allmydata/test/test_workqueue.py index ab151a2c..6f205948 100644 --- a/src/allmydata/test/test_workqueue.py +++ b/src/allmydata/test/test_workqueue.py @@ -28,7 +28,7 @@ class Reuse(unittest.TestCase): # files in the tmpdir are not: these are either in the process of # being added or in the process of being removed. tmpfile = os.path.join(wq.tmpdir, "foo") - f = open(tmpfile, "w") + f = open(tmpfile, "wb") f.write("foo") f.close() # files created with create_tempfile *are* retained, however