New submission from Paul Moore:
See the following test (in Python 3.5):
>>> u'a\nb£'.encode('utf-8').splitlines()
['a', 'b\xc2\xa3']
I encode a string in UTF-8, then use the (bytes) splitlines function on it. The
return value is a list of strings, containing encoded byte values.
The bytes object isn't even documented as having a splitlines method - and if
it does, then it should be returning a list of bytes objects.
----------
components: Interpreter Core
messages: 261289
nosy: paul.moore
priority: normal
severity: normal
status: open
title: bytes splitlines() method returns strings without decoding
versions: Python 3.5, Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26501>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com