[issue27971] utf-16 decoding can't handle lone surrogates

Christoph Reiter report at bugs.python.org
Tue Sep 6 11:10:57 EDT 2016


Christoph Reiter added the comment:

On Tue, Sep 6, 2016 at 4:10 PM, Eryk Sun <report at bugs.python.org> wrote:
> Lone surrogate codes aren't valid Unicode. In Python 3 they get used internally for tricks like the "surrogateescape" error handler. In Python 3.4+. the 'surrogatepass' error handler allows encoding and decoding lone surrogates:

To add some context: I was writing tests for windows paths containing
surrogates (e.g. os.listdir can return them)

----------

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


More information about the Python-bugs-list mailing list