Steffen Daode Nurpmeso sdao...@googlemail.com 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
STINNER Victor victor.stin...@haypocalc.com added the comment:
Attached patch replaces locale.getpreferredencoding() by
locale.getpreferredencoding(False) in _io.TextIOWrapper and _pyio.TextIOWrapper.
--
keywords: +patch
Added file:
Changes by Antoine Pitrou pit...@free.fr:
--
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11022
___
___
Python-bugs-list
R. David Murray rdmur...@bitdance.com 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
Steffen Daode Nurpmeso sdao...@googlemail.com 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*
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
title: locale.setlocale() doesn't change I/O codec, os.environ -
locale.setlocale() doesn't change I/O codec, os.environ does
___
Python tracker rep...@bugs.python.org
New submission from Steffen Daode Nurpmeso sdao...@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
Changes by Steffen Daode Nurpmeso sdao...@googlemail.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11022
___
___
STINNER Victor victor.stin...@haypocalc.com 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
STINNER Victor victor.stin...@haypocalc.com 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
Steffen Daode Nurpmeso sdao...@googlemail.com 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
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11022
___
Antoine Pitrou pit...@free.fr 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
13 matches
Mail list logo