[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Crash is possible not only when reading from text files, but also when decoder returns a non-string or when decoder's state is not a bytes object. This is possible with malicious decoder and perhaps with some old not bytes-to-string decoder in stdlib codecs

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- nosy: +larry priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17106 ___

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Georg Brandl
Georg Brandl added the comment: Blocker for 3.2.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17106 ___ ___ Python-bugs-list mailing list

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This bug exists also in 2.7. I doubt about an exception type. On one hand, TypeError looks naturally here and exception of this type implicitly raised by Python implementation. On other hand, there is a precedent in __iter__() which raises IOError when

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: TypeError should be the right exception here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17106 ___ ___

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yet one crasher, not fixed by my patch yet. io.TextIOWrapper(io.BytesIO(b'a'), newline='\n', encoding='quopri_codec').read(1) Sometimes it crashes (on non-debug build), sometimes raises an exception: ValueError: character U+82228c0 is not in range [U+;

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is an updated patch for 3.3+. An exception type changed to TypeError, fixed some new crashes, added tests. If it is good, I'll backport it to 3.2 and 2.7. -- Added file: http://bugs.python.org/file28941/textio_type_check-3.3_2.patch

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an updated patch for 3.3+. An exception type changed to TypeError, fixed some new crashes, added tests. If it is good, I'll backport it to 3.2 and 2.7. Looks ok to me. -- ___ Python tracker

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are patches for 3.2 and 2.7. Note that due to unicode-str autoconversions 2.7 not always raises TypeError (sometimes it can do nor raise an exception, sometimes it raises UnicodeEncodeError). 2.7 tests are not so strong as 3.x tests. -- Added

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17106 ___ ___

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5655cdd3c010 by Serhiy Storchaka in branch '3.2': Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying http://hg.python.org/cpython/rev/5655cdd3c010 New changeset 0c4cc967a733 by Serhiy Storchaka in branch '3.3': Issue

[issue17106] assertion error in IO reading text file as binary

2013-02-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17106 ___

[issue17106] assertion error in IO reading text file as binary

2013-02-02 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- title: Crash in IO reading text file as binary via email library - assertion error in IO reading text file as binary ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17106

[issue17106] assertion error in IO reading text file as binary

2013-02-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, if a proper type check is made later, then the assert can go. Also, the PyBytes_Size() result should be checked for error, which incidentally ensures the argument is a bytes object. -- ___ Python tracker

[issue17106] assertion error in IO reading text file as binary

2013-02-02 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17106 ___