# HG changeset patch # User Yuya Nishihara # Date 1519912539 18000 # Node ID b075f45456a59a3e9a250039ac6087ac424a26c2 # Parent 8b662717c53f5da1336d3d019509ee315d3164fd py3: fix test-command-template.t to write files in binary mode diff -r 8b662717c53f -r b075f45456a5 tests/test-command-template.t --- a/tests/test-command-template.t Thu Mar 01 08:45:34 2018 -0500 +++ b/tests/test-command-template.t Thu Mar 01 08:55:39 2018 -0500 @@ -2217,9 +2217,9 @@ >>> from __future__ import absolute_import >>> import datetime - >>> fp = open('a', 'w') + >>> fp = open('a', 'wb') >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7) - >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day)) + >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) >>> fp.close() $ hg add a $ hg commit -m future -d "`cat a`" @@ -4573,8 +4573,8 @@ $ hg init nonascii $ cd nonascii $ $PYTHON < open('latin1', 'w').write('\xe9') - > open('utf-8', 'w').write('\xc3\xa9') + > open('latin1', 'wb').write(b'\xe9') + > open('utf-8', 'wb').write(b'\xc3\xa9') > EOF $ HGENCODING=utf-8 hg branch -q `cat utf-8` $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8