Patchwork D2130: py3: replace file() with open() in test-encoding.t

login
register
mail settings
Submitter phabricator
Date Feb. 12, 2018, 11:07 a.m.
Message ID <f7eee228fcd4b85f99ac157848083665@localhost.localdomain>
Download mbox | patch
Permalink /patch/27657/
State Not Applicable
Headers show

Comments

phabricator - Feb. 12, 2018, 11:07 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG035af48b2903: py3: replace file() with open() in test-encoding.t (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2130?vs=5479&id=5483

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

AFFECTED FILES
  tests/test-encoding.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-encoding.t b/tests/test-encoding.t
--- a/tests/test-encoding.t
+++ b/tests/test-encoding.t
@@ -15,9 +15,9 @@ 
   $ hg co
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ $PYTHON << EOF
-  > f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
-  > f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
-  > f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
+  > f = open('latin-1', 'wb'); f.write(b"latin-1 e' encoded: \xe9"); f.close()
+  > f = open('utf-8', 'wb'); f.write(b"utf-8 e' encoded: \xc3\xa9"); f.close()
+  > f = open('latin-1-tag', 'wb'); f.write(b"\xe9"); f.close()
   > EOF
 
 should fail with encoding error