[issue4877] xml.parsers.expat ParseFile() causes segmentation fault when passed a closed file object

Ezio Melotti report at bugs.python.org
Sat Apr 9 03:17:31 CEST 2011


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

FWIW I tried to backport 825041fc8e2c and test_pyexpat runs without problem.
The snippet of code in msg79398 now raises a ValueError:
>>> from xml.parsers import expat
>>> f=open('/tmp/foo')
>>> p=expat.ParserCreate()
>>> f.close()
>>> p.ParseFile(f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: I/O operation on closed file

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4877>
_______________________________________


More information about the Python-bugs-list mailing list