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

Amaury Forgeot d'Arc report at bugs.python.org
Thu Jan 28 19:28:29 CET 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

This is slightly incorrect: if PyFile_FromFile fails for another reason (PyString_FromString(name) runs out of memory), the fp is not closed and the caller is right to call fclose().

IMO PyFile_FromFile() should be changed to consistently leave the fp opened when NULL is returned. But then, many usages of this function are incorrect, e.g in posixmodule.c :-(

----------
nosy: +amaury.forgeotdarc

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


More information about the Python-bugs-list mailing list