Patchwork D7226: tests: write out file using bytes I/O

login
register
mail settings
Submitter phabricator
Date Nov. 5, 2019, 4:04 p.m.
Message ID <1b391a2c90fbb71f3d3d36bb465e3633@localhost.localdomain>
Download mbox | patch
Permalink /patch/42753/
State Not Applicable
Headers show

Comments

phabricator - Nov. 5, 2019, 4:04 p.m.
Closed by commit rHGe7eb67eab53f: tests: write out file using bytes I/O (authored by indygreg).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7226?vs=17548&id=17557

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

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

AFFECTED FILES
  tests/test-highlight.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -966,7 +966,9 @@ 
   $ cd ..
   $ hg init eucjp
   $ cd eucjp
-  $ "$PYTHON" -c 'print("\265\376")' >> eucjp.txt  # Japanese kanji "Kyo"
+  >>> with open('eucjp.txt', 'wb') as fh:
+  ...     # Japanese kanji "Kyo"
+  ...     fh.write(u'\265\376'.encode('utf-8')) and None
   $ hg ci -Ama
   adding eucjp.txt
   $ hgserveget () {