[PATCH 1 of 2] py3: convert to unicode to pass into encode()

timeless timeless at gmail.com
Wed Oct 5 21:01:03 UTC 2016


> @@ -85,6 +85,9 @@
>              # means u.encode(sys.getdefaultencoding()).decode(enc). Since
>              # the Python encoding defaults to 'ascii', this fails if the
>              # translated string use non-ASCII characters.
> +            if (isinstance(encoding.encoding, bytes) and
> +                 sys.version_info[0] >= 3):
> +                 encoding.encoding = encoding.encoding.decode("ascii")

This feels like the kind of check that should be done once (possibly
swapping in the proper function) instead of per call. But I'm not the
owner...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20161005/c9007dc9/attachment-0002.html>


More information about the Mercurial-devel mailing list