[issue39318] NamedTemporaryFile could cause double-close on an fd if _TemporaryFileWrapper throws

Albert Zeyer report at bugs.python.org
Tue Jan 14 04:13:00 EST 2020


Albert Zeyer <albzey at googlemail.com> added the comment:

Why is `except BaseException` better than `except Exception` here? With `except Exception`, you will never run into the problem of possibly closing the fd twice. This is the main important thing which we want to fix here. This is more important than missing maybe to close it at all, or unlink it.

----------

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


More information about the Python-bugs-list mailing list