classification
Title: PyUnicode_AsEncodedString: the bootstrap hack is no more needed
Type: Stage:
Components: Interpreter Core, Unicode Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: haypo
Priority: normal Keywords: patch

Created on 2011-02-11 13:04 by haypo, last changed 2011-02-21 20:53 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
unicode_asencodedstring_bootstrap.patch haypo, 2011-02-11 13:04
Messages (2)
msg128384 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-02-11 13:04
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 ;-)
msg128993 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-02-21 20:53
Fixed by r88476. I prefer to only change it in Python 3.3, so no backport.
History
Date User Action Args
2011-02-21 20:53:17hayposetstatus: open -> closed

messages: + msg128993
resolution: fixed
2011-02-11 13:04:15hayposetcomponents: + Unicode
2011-02-11 13:04:08haypocreate