Patchwork D7081: tests: open file in binary mode in test-upgrade-repo.t

login
register
mail settings
Submitter phabricator
Date Oct. 13, 2019, 4:17 a.m.
Message ID <differential-rev-PHID-DREV-g4o4wqjjixds23rlmevf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42283/
State Superseded
Headers show

Comments

phabricator - Oct. 13, 2019, 4:17 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Otherwise the file sizes printed in the output diverge from other platforms.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-upgrade-repo.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 13, 2019, 5:16 a.m.
This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  Oh, I've been meaning to track this one down. Good catch.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7081/new/

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

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

Patch

diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -452,9 +452,9 @@ 
   >>> from __future__ import absolute_import, print_function
   >>> import random
   >>> random.seed(0) # have a reproducible content
-  >>> with open("f2", "w") as f:
+  >>> with open("f2", "wb") as f:
   ...     for i in range(100000):
-  ...         f.write("%d\n" % random.randint(1000000000, 9999999999)) and None
+  ...         f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
   $ hg -q commit -A -m 'add f2'
 
 make sure we have a .d file