This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Eugene Viktorov, SilentGhost, eryksun, martin.panter, terry.reedy, vstinner
Date 2016-02-20.03:55:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Eryk Sun: The patch proposes to add an unlink() call after the file has been closed:

except Exception:
    _os.close(fd)  # This automatically deletes the file right?
    _os.unlink(name)  # Won’t this raise FileNotFoundError?

By your explanation, it sounds like it would be better to call unlink() before close().

Terry & Victor: Writing the explicit “except BaseException:” makes it clear you weren’t being lazy in figuring out what exceptions you want to catch. But in this case the “raise” at the end of the the exception handler make it clear enough for me. I would be happy with either option.
Date User Action Args
2016-02-20 03:55:50martin.pantersetrecipients: + martin.panter, terry.reedy, vstinner, SilentGhost, eryksun, Eugene Viktorov
2016-02-20 03:55:50martin.pantersetmessageid: <>
2016-02-20 03:55:50martin.panterlinkissue26385 messages
2016-02-20 03:55:50martin.pantercreate