[New-bugs-announce] [issue26501] bytes splitlines() method returns strings without decoding

Paul Moore report at bugs.python.org
Mon Mar 7 05:26:20 EST 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue26501>
_______________________________________


More information about the New-bugs-announce mailing list