Patchwork D5655: tests: use bytes for file I/O

login
register
mail settings
Submitter phabricator
Date Jan. 23, 2019, 5:50 a.m.
Message ID <0164723946c43600adf13a5bdf8295b7@localhost.localdomain>
Download mbox | patch
Permalink /patch/37928/
State Not Applicable
Headers show

Comments

phabricator - Jan. 23, 2019, 5:50 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGabac73eedd4d: tests: use bytes for file I/O (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5655?vs=13351&id=13367

REVISION DETAIL
  https://phab.mercurial-scm.org/D5655

AFFECTED FILES
  tests/test-remotefilelog-histpack.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-remotefilelog-histpack.py b/tests/test-remotefilelog-histpack.py
--- a/tests/test-remotefilelog-histpack.py
+++ b/tests/test-remotefilelog-histpack.py
@@ -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: