[issue12855] open() and codecs.open() treat form-feed differently

STINNER Victor report at bugs.python.org
Mon Aug 29 23:55:57 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

U+000C (Form feed) is considered as a line boundary in Unicode (unicode type), but no for a byte string (str type).

Example:

>>> u'line \x0cone\nline two\n'.splitlines(True)
[u'line \x0c', u'one\n', u'line two\n']
>>> 'line \x0cone\nline two\n'.splitlines(True)
['line \x0cone\n', 'line two\n']

----------
nosy: +haypo

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


More information about the Python-bugs-list mailing list