[issue22232] str.splitlines splitting on non-\r\n characters

Terry J. Reedy report at bugs.python.org
Fri Aug 22 22:34:34 CEST 2014


Terry J. Reedy added the comment:

Objects/unicodeobject.c linebreak is at 266. With 3.4.1:
>>> 'a\x0ab\x0bc\x0cd\x0d1c\x1c1d\x1d1e\x1e'.splitlines()
['a', 'b', 'c', 'd', '1c', '1d', '1e']
\x0a == \n, \x0d == \r

The \r\n pair is a special case, as promised, but other pairs are not.
>>> 'a\r\nb'.splitlines()
['a', 'b']
>>> 'a\x0b\nb'.splitlines()
['a', '', 'b']

----------
nosy: +terry.reedy
title: str.splitlines splitting on none-\r\n characters -> str.splitlines splitting on non-\r\n characters

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


More information about the Python-bugs-list mailing list