D4432: py3: do .decode(), .encode() dance in runtests.py

Yuya Nishihara yuya at tcha.org
Fri Aug 31 20:22:39 EDT 2018


>          def toggletrace(cmd):
> -            quoted = shellquote(cmd.strip()).replace(b'\\', b'\\\\')
> +            cmd = cmd.decode('ascii')
> +            quoted = shellquote(cmd.strip()).encode('ascii')
> +            quoted = quoted.replace(b'\\', b'\\\\')

Perhaps _bytespath/_strpath can be used to avoid possible side effect on
Python 2.


More information about the Mercurial-devel mailing list