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

login
register
mail settings
Submitter phabricator
Date Feb. 28, 2018, 10:29 p.m.
Message ID <differential-rev-PHID-DREV-223pb6qu53ksge6ugxza-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28508/
State Superseded
Headers show

Comments

phabricator - Feb. 28, 2018, 10:29 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This makes the test pass on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-revlog-ancestry.py

CHANGE DETAILS




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

Patch

diff --git a/tests/test-revlog-ancestry.py b/tests/test-revlog-ancestry.py
--- a/tests/test-revlog-ancestry.py
+++ b/tests/test-revlog-ancestry.py
@@ -15,7 +15,7 @@ 
     repo.commit(text=text, date=b"%d 0" % time)
 
 def addcommit(name, time):
-    f = open(name, 'w')
+    f = open(name, 'wb')
     f.write(b'%s\n' % name)
     f.close()
     repo[None].add([name])