Walter Dörwald added the comment:
And returning bytes is documented in PEP 383, as an extension to the PEP 293
machinery:
To convert non-decodable bytes, a new error handler ([2]) surrogateescape
is introduced, which produces these surrogates. On encoding, the error handler
converts the
Changes by Antoine Pitrou pit...@free.fr:
--
assignee: docs@python -
components: +Library (Lib) -Documentation, Interpreter Core, Unicode
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16585
Roundup Robot added the comment:
New changeset 5c88c72dec60 by Benjamin Peterson in branch '3.3':
support encoding error handlers that return bytes (closes #16585)
http://hg.python.org/cpython/rev/5c88c72dec60
New changeset 2181c37977d3 by Benjamin Peterson in branch 'default':
merge 3.3
Roundup Robot added the comment:
New changeset 777aabdff35a by Benjamin Peterson in branch '3.3':
document that encoding error handlers may return bytes (#16585)
http://hg.python.org/cpython/rev/777aabdff35a
--
___
Python tracker
New submission from Philip Jenvey:
surrogateescape claims to be implemented by all standard Python codecs
http://docs.python.org/3/library/codecs.html#codec-base-classes
However it fails w/ multibytecodecs on encode:
Python 3.2.3+ (3.2:eb999002916c, Oct 26 2012, 16:11:03)
[GCC 4.2.1 (Apple
Changes by Serhiy Storchaka storch...@gmail.com:
--
components: +Unicode
nosy: +benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou, serhiy.storchaka
type: - behavior
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
Benjamin Peterson added the comment:
Codecs should be fixed to accept bytes from the error handler and the
definition in the docs loosened. Returning bytes seems to be useful.
--
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - docs@python
components: +Documentation
nosy: +docs@python
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16585