[New-bugs-announce] [issue7732] imp.find_module crashes Python if there exists a directory named "__init__.py"

Trundle report at bugs.python.org
Mon Jan 18 13:07:06 CET 2010


New submission from Trundle <andy-python at hammerhartes.de>:

Create a directory "__init__.py" and execute

>>> import imp
>>> imp.find_module('__init__', ['.'])

to reproduce that issue. It will crash because Python tries to double-close a file pointer: `call_find_module` will call `PyFile_FromFile`, but `PyFile_FromFile` closes the file pointer if it's a directory (by decrefing the created file object) and ` call_find_module` then closes the already closed file.

----------
components: Library (Lib)
messages: 98007
nosy: Trundle
severity: normal
status: open
title: imp.find_module crashes Python if there exists a directory named "__init__.py"
type: crash
versions: Python 2.6

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


More information about the New-bugs-announce mailing list