Amaury Forgeot d'Arc <amaur...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue7732>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to