D6052: global: use raw string for setlocale() argument

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sun Mar 3 05:01:46 EST 2019

yuja added a comment.

  >   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.

  rHG Mercurial


To: indygreg, durin42, #hg-reviewers
Cc: yuja, mercurial-devel

More information about the Mercurial-devel mailing list