Commit 31f05781 authored by Jim Fulton's avatar Jim Fulton

Open blob files in binary mode!

parent dee9727e
......@@ -510,7 +510,7 @@ class BlobStorage(SpecificationDecoratorBase):
fd, name = tempfile.mkstemp(
suffix='.tmp', dir=self.fshelper.temp_dir)
os.close(fd)
utils.cp(open(blobfilename), open(name, 'wb'))
utils.cp(open(blobfilename, 'rb'), open(name, 'wb'))
self.restoreBlob(record.oid, record.tid, record.data,
name, record.data_txn, trans)
else:
......
......@@ -224,7 +224,7 @@ class IteratorDeepCompare:
else:
fn2 = storage2.loadBlob(rec1.oid, rec1.tid)
self.assert_(fn1 != fn2)
eq(open(fn1).read(), open(fn2).read())
eq(open(fn1, 'rb').read(), open(fn2, 'rb').read())
# Make sure there are no more records left in rec1 and rec2,
# meaning they were the same length.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment