# HG changeset patch # User Gregory Szorc # Date 1548210292 28800 # Node ID abac73eedd4d71d53c093ef28e97f5c5142b8bdd # Parent 4ef28d7e22ae0054c7597fbbf4cbedf04c93023d tests: use bytes for file I/O Otherwise we get various type mismatches. Differential Revision: https://phab.mercurial-scm.org/D5655 diff -r 4ef28d7e22ae -r abac73eedd4d tests/test-remotefilelog-histpack.py --- 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: