Patchwork D3787: py3: encode sys.argv to bytes using .encode()

login
register
mail settings
Submitter phabricator
Date June 18, 2018, 12:33 p.m.
Message ID <59d9ed15768642ce6d88da039a5f8483@localhost.localdomain>
Download mbox | patch
Permalink /patch/32260/
State Not Applicable
Headers show

Comments

phabricator - June 18, 2018, 12:33 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbf953d218a91: py3: encode sys.argv to bytes using .encode() (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3787?vs=9158&id=9170

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

AFFECTED FILES
  tests/test-import-context.t
  tests/test-patch-offset.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-patch-offset.t b/tests/test-patch-offset.t
--- a/tests/test-patch-offset.t
+++ b/tests/test-patch-offset.t
@@ -8,7 +8,7 @@ 
   > fp = open(path, 'wb')
   > for pattern in patterns:
   >     count = int(pattern[0:-1])
-  >     char = pattern[-1] + '\n'
+  >     char = pattern[-1].encode('utf8') + b'\n'
   >     fp.write(char*count)
   > fp.close()
   > EOF
diff --git a/tests/test-import-context.t b/tests/test-import-context.t
--- a/tests/test-import-context.t
+++ b/tests/test-import-context.t
@@ -10,7 +10,7 @@ 
   > fp = open(path, 'wb')
   > for i, pattern in enumerate(patterns):
   >     count = int(pattern[0:-1])
-  >     char = pattern[-1] + '\n'
+  >     char = pattern[-1].encode('utf8') + b'\n'
   >     if not lasteol and i == len(patterns) - 1:
   >         fp.write((char*count)[:-1])
   >     else: