diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1352,7 +1352,9 @@ if PYTHON3: session = session.encode('ascii') def toggletrace(cmd): - quoted = shellquote(cmd.strip()).replace(b'\\', b'\\\\') + cmd = cmd.decode('utf8') + quoted = shellquote(cmd.strip()).encode('utf8') + quoted = quoted.replace(b'\\', b'\\\\') if active: script.append( b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (