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

2011-02-01 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: Most of this is much too loud for a newbie who is about to read PEP 7 anyway. And if this community has chosen to try (?!?) not to break compatibility with code which does not have a notion of a locale setting (i.e. naively uses other code in that sp

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

2011-01-31 Thread R. David Murray
R. David Murray added the comment: Steffan: I'm not sure what your post means, but I think there is a chance you might be confused about something. Python should *never* change the locale from the C locale. A Python *program* can do so, by calling setlocale, but Python itself should not. T

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

2011-01-31 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

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

2011-01-31 Thread STINNER Victor
STINNER Victor added the comment: Attached patch replaces locale.getpreferredencoding() by locale.getpreferredencoding(False) in _io.TextIOWrapper and _pyio.TextIOWrapper. -- keywords: +patch Added file: http://bugs.python.org/file20637/io_dont_set_locale.patch ___

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

2011-01-29 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: Also in respect to Issue 6203 i could talk about a project which did not link against anything in the end, only ld(1) and syscalls and the undocumented third 'char **envp' arg to UNIX main()s. Thus: all of you should be *very* happy about the warm and

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

2011-01-28 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- title: locale.setlocale() doesn't change I/O codec, os.environ -> locale.setlocale() doesn't change I/O codec, os.environ does ___ Python tracker ___

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

2011-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Both cases indicate the users desire to change a specific locale > setting and thus - of course - all the changes which that implies! > So why should there be a difference? I don't think it's intentional. I would be +1 on changing to getpreferredencoding(Fal

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

2011-01-27 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

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

2011-01-27 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: > Anyway, I don't know understand why do you change your locale, > because you know that your file encoding is Latin1. Why don't you > use directly: open(filename, encoding='latin1')? Fortunately Issue 9124 is being solved soon due to the very active ha

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

2011-01-27 Thread STINNER Victor
STINNER Victor added the comment: > This bug may be based on same problem as Issue 6203. Nope, both issues are different. Here you want that TextIOWrapper reads your current locale, and not your environment variables. Issue #6203 asks why LC_CTYPE is not C by default, but the user locale LC_C

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

2011-01-27 Thread STINNER Victor
STINNER Victor added the comment: > - Using locale.setlocale(..., ...) > - Re-open causes same error, I/O layer codec has not been changed! Yes, this is the expected behaviour with the current code. TextIOWrapper uses indirectly locale.getpreferredencoding() to choose your file encoding. If l

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

2011-01-27 Thread Steffen Daode Nurpmeso
Changes by Steffen Daode Nurpmeso : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

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

2011-01-27 Thread Steffen Daode Nurpmeso
New submission from Steffen Daode Nurpmeso : 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 cause