[PATCH 4 of 6] i18n: use unicode literals to appease Python 3

Yuya Nishihara yuya at tcha.org
Sat Jun 4 10:00:21 EDT 2016


On Tue, 31 May 2016 22:53:01 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1464759144 25200
> #      Tue May 31 22:32:24 2016 -0700
> # Node ID 58033b58046aecaf64f59b3557f50b2aacfe98b5
> # Parent  fae2a2edc2a1e9d507f1c882c58e4d30962815a2
> i18n: use unicode literals to appease Python 3

> +    exceptions = os.environ.get(u'HGPLAINEXCEPT', u'').strip().split(u',')
> +    return u'i18n' not in exceptions

It may raise UnicodeDecodeError on Python 2 because environ is bytes.

HGPLAINEXCEPT=<non-ascii> hg

I haven't read the whole series yet, but I'm surprised that we'll need a bunch
of unicode strings to get along with Python 3. Even __doc__ can't be bytes.


More information about the Mercurial-devel mailing list