[issue13619] Add a new codec: "locale", the current locale encoding

2012-02-10 Thread STINNER Victor
STINNER Victor added the comment: According to the discussion on the python-dev mailing list, such codec would add too much confusion to users and so it is better to not add it. http://mail.python.org/pipermail/python-dev/2012-February/116272.html I close the issue as wont fix. -- res

[issue13619] Add a new codec: "locale", the current locale encoding

2012-02-07 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file23987/locale_encoding-2.patch ___ Python tracker ___ ___ Python-bugs-list

[issue13619] Add a new codec: "locale", the current locale encoding

2012-02-07 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file23985/locale_encoding.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue13619] Add a new codec: "locale", the current locale encoding

2012-02-07 Thread STINNER Victor
STINNER Victor added the comment: > + encoding = locale.getpreferredencoding() > It should be locale.getpreferredencoding(False). Fixed in patch version 3. -- Added file: http://bugs.python.org/file24446/locale_encoding-3.patch ___ Python tracker <

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure I like this idea. I think it would be nice to see it discussed on python-dev. -- nosy: +pitrou ___ Python tracker ___ ___

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-22 Thread STINNER Victor
STINNER Victor added the comment: + encoding = locale.getpreferredencoding() It should be locale.getpreferredencoding(False). -- ___ Python tracker ___

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-20 Thread STINNER Victor
STINNER Victor added the comment: I would be possible to implement incremental decoder with mbsrtowcs() and incremental encoder with wcsrtombs(), by serializing mbstate_t to a long integer (TextIOWrapper.tell() does something like that). The problem is that mbsrtowcs() and wcsrtombs() are "re

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-17 Thread STINNER Victor
STINNER Victor added the comment: I tested locale_encoding-2.patch on Linux, FreeBSD and Windows: UTF-8 and ISO-8859-1 locales on Linux and FreeBSD, and the cp1252 ANSI code page on Windows. -- ___ Python tracker

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-17 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Unicode nosy: +ezio.melotti, lemburg stage: -> patch review type: -> enhancement ___ Python tracker ___ __

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-17 Thread STINNER Victor
STINNER Victor added the comment: Patch version 2: improve the test. Try also the user locale encoding if the C locale uses ISO-8859-1 (should improve the code coverage on FreeBSD, Mac OS X and Solaris). -- Added file: http://bugs.python.org/file23987/locale_encoding-2.patch

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-16 Thread STINNER Victor
STINNER Victor added the comment: # On FreeBSD, Solaris and Mac OS X, b'\xff' can be decoded in # the C locale. The C locale is something like ISO-8859-1, not # 7-bit ASCII. On FreeBSD, it *is* the ISO-8859-1 encoding. -- ___ Python tracker

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-16 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file23985/locale_encoding.patch ___ Python tracker ___

[issue13619] Add a new codec: "locale", the current locale encoding

2011-12-16 Thread STINNER Victor
New submission from STINNER Victor : To factorize the code and to fix encoding issues in the time module, I added functions to decode/encode from/to the locale encoding: PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() and PyUnicode_EncodeLocale() (issue #13560). During tests, I reali