D6052: global: use raw string for setlocale() argument
Yuya Nishihara
yuya at tcha.org
Sun Mar 3 05:00:15 EST 2019
> After this series, the number of test failures in that mode is ~70. Most of the remaining failures are in `stringutil.wrap()`. Essentially `textwrap` from the standard library wants to operate on native `str`. Our version is feeding in `unicode`. We get into trouble when the standard library code does a `''.join()` and some `unicode` is coerced into `str`. TBH I'm not sure how we're not seeing bugs due to this on Python 2. I'm guessing we're lacking test coverage for something passing non-ASCII into `stringutil.wrap()`?
Can you share some example of the test failure?
I'm not sure what's wrong with the textwrap. AFAIK, it's string-neutral.
`''.join()` would return a unicode string if one of the inputs is a unicode,
and the others are all ASCII bytes.
More information about the Mercurial-devel
mailing list