On Wed, Dec 14, 2016 at 10:40 PM, Nick Coghlan <ncoghlan(a)gmail.com> wrote:
I opened an issue and attached a patch at
https://bugzilla.redhat.com/show_bug.cgi?id=1404918
I also cross-linked it with the most recent upstream issue at
http://bugs.python.org/issue28180
Comments on the patch:
* In:
http://bugs.python.org/issue28180#msg282964 you mentioned
adding a "PYTHONKEEPASCIILOCALE environment variable to turn that
behaviour off". but this patch doesn't implement thta. I think that
will be necessary to address the cross-platform debuggability concern
I had eearlier in the thread.
* I'm not 100% certain that LC_CTYPE is the best thing to check.
People will set LC_CTYPE in conjunction with LC_COLLATE to C to get a
predictable sort order.(CTYPE is needed because bytes can be
interpreted as different characters and those differences can affect
sort order.). Changing this will mean that their command line sort
order (ls, sort, etc) could differ from python's sort order. I
haven't thought this fully through or a better way to check for our
actual meaning, though, and perhaps python already uses LC_CTYPE in
ways that would differ from other unix tools?
* Thinking about whether this belongs in the library or the
interpreter some more I'm seeing some hefty cons in both directions.
already noted that the con for doing it in the interpreter is that we
get out of sync with other things linking to libpython, therefore
making debugging harder. The con for doing it in the library is that
the environment is global to the process. So mucking with it in the
library would affect the entire application, not just the portion
that's interpreting python. Not sure what to do here....
-Toshio