[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

STINNER Victor report at bugs.python.org
Fri Jun 17 17:41:07 CEST 2011


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

> What about something like .decode('mbcs', errors='windows')?

Yes, we can use an error handler specific to the mbcs codec, but I would prefer to not introduce special error handlers.

For os.fsencode(), we can keep it unchanged, or add an optional "flags" argument to codecs.mbcs_decode().

> I still don't see the advantage of codecs.code_page_encode().

codecs.code_page_encode() and codecs.code_page_decode() are required for unit tests. If you don't want to add new public (C and Python) functions, we may add them to _testcapi.

----------

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


More information about the Python-bugs-list mailing list