tests: use bytes for file I/O
Otherwise we get various type mismatches.
Differential Revision: https://phab.mercurial-scm.org/D5655
--- a/tests/test-remotefilelog-histpack.py Tue Jan 22 18:23:47 2019 -0800
+++ b/tests/test-remotefilelog-histpack.py Tue Jan 22 18:24:52 2019 -0800
@@ -232,12 +232,12 @@
def testBadVersionThrows(self):
pack = self.createPack()
- path = pack.path + '.histpack'
- with open(path) as f:
+ path = pack.path + b'.histpack'
+ with open(path, 'rb') as f:
raw = f.read()
raw = struct.pack('!B', 255) + raw[1:]
os.chmod(path, os.stat(path).st_mode | stat.S_IWRITE)
- with open(path, 'w+') as f:
+ with open(path, 'wb+') as f:
f.write(raw)
try: