From patchwork Mon Feb 12 11:07:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2130: py3: replace file() with open() in test-encoding.t From: phabricator X-Patchwork-Id: 27657 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 12 Feb 2018 11:07:08 +0000 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 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