[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-25 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, part of the confusion is that I misremembered the command we run implicitly during startup - it's only `setlocale(LC_CTYPE, "")`, not `setlocale(LC_ALL, "")`. However, the default category for `locale.getlocale()` is `LC_CTYPE`, so it reports the text

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-25 Thread STINNER Victor
STINNER Victor added the comment: When testing this issue, I found a bug in Python :-( I opened bpo-33954: float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error. -- ___ Python tracker

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-24 Thread Nicolas Hainaux
Nicolas Hainaux added the comment: I understand that the statement "when python starts, it runs using the C locale..." should not be correct anymore (and the doc should then be updated), but in fact this statement is still true on the systems I tested; only, the output of locale.getlocale()

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-23 Thread Nick Coghlan
Nick Coghlan added the comment: This statement is no longer correct: "when python starts, it runs using the C locale, on any platform (Windows, Linux, BSD), any python version (2, 3...), until locale.setlocale() is used to set another locale." The Python 3 text model doesn't work properly

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-23 Thread Ned Deily
Ned Deily added the comment: Thanks for the more detailed explanation. I think you are right that the behavior does not match the documentation but which is to be preferred does not necessarily have an easy answer. Also, this whole area has been undergoing revision, for example, with new

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-23 Thread Nicolas Hainaux
Nicolas Hainaux added the comment: Sorry, I did not realize that using the word "unset" was completely misleading: I only meant "before any use of locale.setlocale() in python". So I'll rephrase this all, and add details about the python versions and platforms in this message. So, first, I

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-22 Thread Ned Deily
Ned Deily added the comment: Can you say on which Linux platform/release you see this behavior and with which Python 3.6.3, i.e. from the platform distributor or built yourself? If I understand your concern correctly, I cannot reproduce that behavior on a current Debian test system using

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-21 Thread Nicolas Hainaux
New submission from Nicolas Hainaux : Expected behaviour: When unset, the locale in use is `C` (as stated in python documentation) and `locale.getlocale()` returns `(None, None)` on Linux with python2.7 or on Windows with python2.7 and python 3.6 (at least): $ python2 Python 2.7.15