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
--- 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':