changeset 36337:0f36926b2651

py3: make sure we open file in bytes mode Differential Revision: https://phab.mercurial-scm.org/D2360
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 21 Feb 2018 00:25:16 +0530
parents 236596a67a54
children ddd9474d2e08
files tests/test-ui-color.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-ui-color.py	Wed Feb 21 00:24:44 2018 +0530
+++ b/tests/test-ui-color.py	Wed Feb 21 00:25:16 2018 +0530
@@ -15,7 +15,7 @@
 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_.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.