[issue8715] Create PyUnicode_EncodeFSDefault() function

2010-05-15 Thread STINNER Victor
STINNER Victor added the comment: Commited as r81194 (py3k), blocked in 3.1 (r81195). -- resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue8715] Create PyUnicode_EncodeFSDefault() function

2010-05-15 Thread STINNER Victor
STINNER Victor added the comment: PyUnicode_AsEncodedString() contains a special path for the file system encoding. I don't think that it is still needed, but I don't know how to check that. /* During bootstrap, we may need to find the encodings package, to load the file system enc

[issue8715] Create PyUnicode_EncodeFSDefault() function

2010-05-15 Thread STINNER Victor
STINNER Victor added the comment: > bootstrap failure on Windows: import did use default error handler, > it uses surrogateescape error handler, but PyUnicode_EncodeString() > doesn't have codec "fast-path" for MBCS+surrogateescape. I enabled "shortcuts" in PyUnicode_EncodeString() for any err

[issue8715] Create PyUnicode_EncodeFSDefault() function

2010-05-14 Thread STINNER Victor
STINNER Victor added the comment: Notes for myself: - "Encodes" and "fallback" in .h documentation => "Encode", "fall back" - bootstrap failure on Windows: import did use default error handler, it uses surrogateescape error handler, but PyUnicode_EncodeString() doesn't have codec "fast-path

[issue8715] Create PyUnicode_EncodeFSDefault() function

2010-05-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file17340/pyunicode_encodefsdefault-2.patch ___ Python tracker ___ ___ Python-

[issue8715] Create PyUnicode_EncodeFSDefault() function

2010-05-14 Thread STINNER Victor
STINNER Victor added the comment: Ooops, I attached the wrong version of the patch. Version 3 changes the documentation (Encodes => Encode). -- Added file: http://bugs.python.org/file17341/pyunicode_encodefsdefault-3.patch ___ Python tracker

[issue8715] Create PyUnicode_EncodeFSDefault() function

2010-05-14 Thread STINNER Victor
New submission from STINNER Victor : PyUnicode_EncodeFSDefault() is the opposite of PyUnicode_DecodeFSDefault(AndSize)() and is similar to the new function os.fsencode(). As you can see in the patch, it simplifies many functions. /* Encodes a Unicode object to Py_FileSystemDefaultEncoding with