py3: make dummyssh compatible with Python 3
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 11 Feb 2018 19:11:17 -0800
changeset 36121 3a763d7f40e1
parent 36120 54dfb65e2f82
child 36122 7db243288afb
py3: make dummyssh compatible with Python 3 Required encoding a str to bytes and writing bytes to a file descriptor. Differential Revision: https://phab.mercurial-scm.org/D2170
tests/dummyssh
--- a/tests/dummyssh	Sun Feb 11 18:58:45 2018 -0800
+++ b/tests/dummyssh	Sun Feb 11 19:11:17 2018 -0800
@@ -15,8 +15,8 @@
 log = open("dummylog", "ab")
 log.write(b"Got arguments")
 for i, arg in enumerate(sys.argv[1:]):
-    log.write(b" %d:%s" % (i + 1, arg))
-log.write("\n")
+    log.write(b" %d:%s" % (i + 1, arg.encode('latin1')))
+log.write(b"\n")
 log.close()
 hgcmd = sys.argv[2]
 if os.name == 'nt':