Patchwork D2360: py3: make sure we open file in bytes mode

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 12:57 p.m.
Message ID <42d20e9341161ac13b0aba7258f9b9cb@localhost.localdomain>
Download mbox | patch
Permalink /patch/28183/
State Not Applicable
Headers show

Comments

phabricator - Feb. 21, 2018, 12:57 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0f36926b2651: py3: make sure we open file in bytes mode (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2360?vs=5938&id=5941

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

AFFECTED FILES
  tests/test-ui-color.py

CHANGE DETAILS




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

Patch

diff --git a/tests/test-ui-color.py b/tests/test-ui-color.py
--- a/tests/test-ui-color.py
+++ b/tests/test-ui-color.py
@@ -15,16 +15,16 @@ 
 print(repr(testui.popbuffer()))
 
 # test dispatch.dispatch with the same ui object
-hgrc = open(os.environ["HGRCPATH"], 'w')
+hgrc = open(os.environ["HGRCPATH"], 'wb')
 hgrc.write(b'[extensions]\n')
 hgrc.write(b'color=\n')
 hgrc.close()
 
 ui_ = uimod.ui.load()
 ui_.setconfig(b'ui', b'formatted', b'True')
 
 # we're not interested in the output, so write that to devnull
-ui_.fout = open(os.devnull, 'w')
+ui_.fout = open(os.devnull, 'wb')
 
 # call some arbitrary command just so we go through
 # color's wrapped _runcommand twice.