Patchwork D2077: py3: make sure we open the file in bytes mode

login
register
mail settings
Submitter phabricator
Date Feb. 7, 2018, 11:23 a.m.
Message ID <47787d2199762484c1b25327c1742cac@localhost.localdomain>
Download mbox | patch
Permalink /patch/27417/
State Not Applicable
Headers show

Comments

phabricator - Feb. 7, 2018, 11:23 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG80e5210df25c: py3: make sure we open the file in bytes mode (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2077?vs=5283&id=5291

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

AFFECTED FILES
  tests/test-check-help.t
  tests/test-conflict.t

CHANGE DETAILS




To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/tests/test-conflict.t b/tests/test-conflict.t
--- a/tests/test-conflict.t
+++ b/tests/test-conflict.t
@@ -138,7 +138,7 @@ 
 
   $ hg up -q --clean .
   $ $PYTHON <<EOF
-  > fp = open('logfile', 'w')
+  > fp = open('logfile', 'wb')
   > fp.write(b'12345678901234567890123456789012345678901234567890' +
   >          b'1234567890') # there are 5 more columns for 80 columns
   > 
diff --git a/tests/test-check-help.t b/tests/test-check-help.t
--- a/tests/test-check-help.t
+++ b/tests/test-check-help.t
@@ -12,7 +12,7 @@ 
   > topics = set()
   > topicre = re.compile(br':hg:`help ([a-z0-9\-.]+)`')
   > for fname in sys.argv:
-  >     with open(fname) as f:
+  >     with open(fname, 'rb') as f:
   >         topics.update(m.group(1) for m in topicre.finditer(f.read()))
   > for s in sorted(topics):
   >     print(s)