[issue11022] locale.setlocale() doesn't change I/O codec, os.environ[] does

Steffen Daode Nurpmeso report at bugs.python.org
Thu Jan 27 12:00:25 CET 2011


New submission from Steffen Daode Nurpmeso <sdaoden at googlemail.com>:

This bug may be based on same problem as Issue 6203.
- My system locale is en_GB.UTF-8.
- Given a latin1 text file, open()+ will fail with
  'UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6...'
- Using locale.setlocale(..., ...)
- Re-open causes same error, I/O layer codec has not been changed!
- Using os.environ["LC_ALL"] = ...
- Re-open works properly, I/O layer codec has been changed.
P.S.: i am new to Python, please don't assume i can help in solving the problem!

----------
components: Library (Lib)
messages: 127177
nosy: sdaoden
priority: normal
severity: normal
status: open
title: locale.setlocale() doesn't change I/O codec, os.environ[] does
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11022>
_______________________________________


More information about the Python-bugs-list mailing list