[issue25867] os.stat raises exception when using unicode and no locale is set

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > It's doing this now, so seems like it has been fixed: % env -i ./python.exe > (...) Right. It's correct to close the issue. The PEP 540 added a UTF-8 Mode. This mode is enabled if Python is started with the "C" or "POSIX" locale (LC_CTYPE category). If

[issue25867] os.stat raises exception when using unicode and no locale is set

2021-08-26 Thread Eryk Sun
Eryk Sun added the comment: > It's doing this now, so seems like it has been fixed Yes. In POSIX systems since Python 3.7, if the LC_CTYPE locale is the legacy "C" or "POSIX" locale, by default it tries to coerce LC_CTYPE to "C.UTF-8", "C.utf8", or "UTF-8". If coercion fails or is disabled

[issue25867] os.stat raises exception when using unicode and no locale is set

2021-08-26 Thread Irit Katriel
Irit Katriel added the comment: It's doing this now, so seems like it has been fixed: % env -i ./python.exe Python 3.11.0a0 ... >>> import os >>> os.stat(u"\xf0") Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: 'ð' >>>

[issue25867] os.stat raises exception when using unicode and no locale is set

2015-12-15 Thread Ondrej Sejvl
New submission from Ondrej Sejvl: os.stat() raises exception UnicodeEncodeError when path is unicode and no locale is set in envinronment (this occures when running app with daemon tools -> LC_ALL=) How to simulate: $ env -i python >>> import os >>> os.stat(u"\xf0") Traceback (most recent

[issue25867] os.stat raises exception when using unicode and no locale is set

2015-12-15 Thread R. David Murray
R. David Murray added the comment: I don't think this is "intentional", but instead is a consequence of how things used to work before we started to try to handle empty/C locale better. It applies to python3 as well. Since we only started trying to handle this in python3, I'm not sure that