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

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Sun Oct 13 02:11:08 EDT 2019


Closed by commit rHG86b26f20146d: tests: open file in binary mode in test-upgrade-repo.t (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7081?vs=17123&id=17126

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

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

AFFECTED FILES
  tests/test-upgrade-repo.t

CHANGE DETAILS

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



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


More information about the Mercurial-devel mailing list