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 surrogate back to the corresponding byte. This error handler will be used in any API that receives or produces file names, command line arguments, or environment variables.
The error handler interface is extended to allow the encode error handler to return byte strings immediately, in addition to returning Unicode strings which then get encoded again (also see the discussion below)."""
----------
nosy: +doerwalter
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue16585>
_______________________________________
Éric Araujo added the comment:
Any reason to not backport this?
----------
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue9650>
_______________________________________
New submission from mindrones:
Hi,
at http://docs.python.org/2.7/library/pprint.html#pprint.PrettyPrinter we see:
"class pprint.PrettyPrinter(...)"
while at http://docs.python.org/3.3/library/pprint.html#pprint.PrettyPrinter we see:
"class pprint.PrettyPrinter(indent=1, width=80, depth=None, stream=None)"
I think the first case is a bug.
Regards,
Luca
----------
assignee: docs@python
components: Documentation
messages: 176745
nosy: docs@python, mindrones
priority: normal
severity: normal
status: open
title: PrettyPrinter docs is incomplete
versions: Python 2.7
_______________________________________
Python tracker <report(a)bugs.python.org>
<http://bugs.python.org/issue16589>
_______________________________________