# HG changeset patch # User Gregory Szorc # Date 1518405077 28800 # Node ID 3a763d7f40e14d9af0c2ded935ee18e31f3d5cf9 # Parent 54dfb65e2f82eedfe0bde3a762cc09c6cce91078 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 diff --git a/tests/dummyssh b/tests/dummyssh --- a/tests/dummyssh +++ b/tests/dummyssh @@ -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':