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
Changes by Georg Brandl ge...@python.org:
--
nosy: +larry
priority: normal - release blocker
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17106
___
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
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
Antoine Pitrou added the comment:
TypeError should be the right exception here.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17106
___
___
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+;
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
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
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
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17106
___
___
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
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
___
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
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
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17106
___
15 matches
Mail list logo