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 call last): File "<stdin>", line 1, in <module> UnicodeEncodeError: 'ascii' codec can't encode character u'\xf0' in position 0: ordinal not in range(128) Is this a valid behaviour? Then maybe some notification in documentation would be nice (I am using os.path.isfile and now UnicodeEncodeError raised...) Thanks Ondra ---------- messages: 256446 nosy: sejvlond priority: normal severity: normal status: open title: os.stat raises exception when using unicode and no locale is set _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25867> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com