# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-02-20 18:55:16 # Node ID 0f36926b2651a65944bca6e4247600791e253438 # Parent 236596a67a54b18ddbbcadcf94cb3051528ad83d py3: make sure we open file in bytes mode Differential Revision: https://phab.mercurial-scm.org/D2360 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,7 +15,7 @@ testui.write_err(b'error\n') 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() @@ -24,7 +24,7 @@ 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.