[issue13216] Add cp65001 codec

STINNER Victor report at bugs.python.org
Wed Oct 19 20:25:33 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> > Sorry, which bug?

> #6501 and friends

Hum, this particular issue, #6501, doesn't concern the code page 65001. The typical usecase (issues #7441 and #10920) is:
------------
C:\victor\cpython>chcp 65001
Page de codes active : 65001

C:\victor\cpython>pcbuild\python_d.exe
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: cp65001
------------

The console and console output code pages may be changed by something else.

The current workaround is to set PYTHONIOENCODING environment variable to utf-8, but as explained in msg132831, the workaround is not applicable if Python is embeded or if the program has been frozen by cx-freeze ("cx-freeze deliberately sets Py_IgnoreEnvironmentFlag").

--

The issue #6501 was a bug in io.device_encoding(). I fixed it in Python 3.3 and I'm waiting... since 5 months... for Graham Dumpleton before backporting the fix. The issue suggests also to not fail if the encoding cannot be found (I dislike this idea).

----------

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


More information about the Python-bugs-list mailing list