[issue18337] codecs: StremReader readline() breaks on undocumented characters
New submission from Thomas Guettler: The stream reader of codecs.open() breaks on undocumented characters: http://docs.python.org/2/library/codecs.html?highlight=codecs%20readline#cod... import tempfile temp=tempfile.mktemp() fd=open(temp, 'wb') fd.write('abc\ndef\x85ghi') fd.close() import codecs fd=codecs.open(temp, 'rb', 'latin1') while True: line=fd.readline() if not line: break print repr(line) Result: u'abc\n' u'def\x85' u'ghi' Related: http://stackoverflow.com/questions/16227114/utf-8-files-read-in-python-will-... ---------- assignee: docs@python components: Documentation messages: 192112 nosy: docs@python, guettli priority: normal severity: normal status: open title: codecs: StremReader readline() breaks on undocumented characters versions: Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18337> _______________________________________
Serhiy Storchaka added the comment: Thank you for your report. This is a duplicate of issue18291. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> codecs.open interprets space as line ends versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18337> _______________________________________
participants (2)
-
Serhiy Storchaka
-
Thomas Guettler