[issue34157] NamedTemporaryFile can leave temporary files behind

R. David Murray report at bugs.python.org
Fri Jul 20 12:35:12 EDT 2018


R. David Murray <rdmurray at bitdance.com> added the comment:

Nick, what Jakub is saying is that 'with' hasn't even gotten involved yet: we're still executing the NamedTemporaryFile constructor, so the object hasn't been returned for 'with' to operate on yet.  In other words, NamedTemporaryFile.__init__ isn't safe against ctl-C when it calls _mkstemp, which is obvious by inspection since it isn't inside the try/except.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34157>
_______________________________________


More information about the Python-bugs-list mailing list