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

2011-08-29 Thread Matthew Boehm
Matthew Boehm added the comment: I'm taking a look at the docs now. I'm considering adding a table/list of characters python treats as newlines, but it seems like this might fit better as a note in http://docs.python.org/library/stdtypes.html#str.splitlines or somewhere else in stdtypes. I'l

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

2011-08-29 Thread Matthew Boehm
Matthew Boehm added the comment: I'll suggest a patch for the documentation when I get to my home computer in an hour or two. -- assignee: -> docs@python components: +Documentation -Interpreter Core nosy: +docs@python resolution: wont fix -> status: closed -> open __

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

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: > It would be nice if it fit in the docs somewhere, > but I'm not sure where. See: http://docs.python.org/library/codecs.html#codecs.StreamReader.readline Can you suggest a patch for the documentation? Source code of this document: http://hg.python.org/cpython

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

2011-08-29 Thread Matthew Boehm
Changes by Matthew Boehm : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2011-08-29 Thread Matthew Boehm
Matthew Boehm added the comment: Thanks for explaining the reasoning. Perhaps I should add this to the python wiki (http://wiki.python.org/moin/Unicode) ? It would be nice if it fit in the docs somewhere, but I'm not sure where. I'm curious how (or if) 2to3 would handle this as well, but I'm

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

2011-08-29 Thread STINNER Victor
STINNER Victor 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(Tru

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

2011-08-29 Thread Matthew Boehm
New submission from Matthew Boehm : A file opened with codecs.open() splits on a form feed character (\x0c) while a file opened with open() does not. >>> with open("formfeed.txt", "w") as f: ... f.write("line \fone\nline two\n") ... >>> with open("formfeed.txt", "r") as f: ... s = f.read()