Patchwork D2110: py3: replace file() with open() in test-clone.t

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2018, 12:39 p.m.
Message ID <differential-rev-PHID-DREV-w4golf3qw2gnzx2ppa2d-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27525/
State Superseded
Headers show

Comments

phabricator - Feb. 11, 2018, 12:39 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  While I was here, I made sure we write things correctly in bytes mode.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-clone.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -10,7 +10,7 @@ 
 
 Create a non-inlined filelog:
 
-  $ $PYTHON -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))'
+  $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
   $ for j in 0 1 2 3 4 5 6 7 8 9; do
   >   cat data1 >> b
   >   hg commit -m test