[New-bugs-announce] [issue17106] Crash in IO reading text file as binary via email library
R. David Murray
report at bugs.python.org
Sat Feb 2 21:13:44 CET 2013
New submission from R. David Murray:
I came across this by making a mistake, but it shouldn't crash:
rdmurray at hey:~/python/p32>touch temp
rdmurray at hey:~/python/p32>./python
Python 3.2.3+ (3.2:e6952acd5a55+, Feb 2 2013, 15:04:21)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email import message_from_binary_file as mb
>>> m = mb(open('temp'))
python: ./Modules/_io/textio.c:1454: textiowrapper_read_chunk: Assertion `((((((PyObject*)(input_chunk))->ob_type))->tp_flags & ((1L<<27))) != 0)' failed.
zsh: abort ./python
This is a regression relative to 3.2.3:
Python 3.2.3 (default, Sep 16 2012, 16:35:39)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email import message_from_binary_file as mb
>>> m = mb(open('temp'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.2/email/__init__.py", line 63, in
message_from_binary_file
return BytesParser(*args, **kws).parse(fp)
File "/usr/lib/python3.2/email/parser.py", line 124, in parse
return self.parser.parse(fp, headersonly)
File "/usr/lib/python3.2/email/parser.py", line 68, in parse
data = fp.read(8192)
File "/usr/lib/python3.2/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
TypeError: 'str' does not support the buffer interface
----------
components: IO
keywords: 3.2regression
messages: 181210
nosy: georg.brandl, pitrou, r.david.murray
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Crash in IO reading text file as binary via email library
type: crash
versions: Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17106>
_______________________________________
More information about the New-bugs-announce
mailing list