[New-bugs-announce] [issue11187] PyUnicode_AsEncodedString: the bootstrap hack is no more needed

STINNER Victor report at bugs.python.org
Fri Feb 11 14:04:11 CET 2011


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

Since version 3.2, Python uses the locale encoding in PyUnicode_EncodeFSDefault() using _Py_wchar2char() and _Py_char2wchar() until the codec registry is initialized and the locale codec is loaded (until initfsencoding() is done).

Before Python 3.2, Python used ASCII in PyUnicode_AsEncodedString() at bootstrap  (before the codec registry was initialized): we don't need this hack anymore and it is bad to use ASCII instead of the locale encoding (encode/decode can fail).

This ticket is just a reminder for me: I am waiting Python 3.3 to remove PyUnicode_AsEncodedString() bootstrap hack ;-)

----------
components: Interpreter Core
files: unicode_asencodedstring_bootstrap.patch
keywords: patch
messages: 128384
nosy: haypo
priority: normal
severity: normal
status: open
title: PyUnicode_AsEncodedString: the bootstrap hack is no more needed
versions: Python 3.3
Added file: http://bugs.python.org/file20744/unicode_asencodedstring_bootstrap.patch

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


More information about the New-bugs-announce mailing list