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 StillSubjectToChange
Recipients StillSubjectToChange, mieczyslaw.torchala
Date 2021-01-28.11:03:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611831791.27.0.308373189642.issue42830@roundup.psfhosted.org>
In-reply-to
Content
Perhaps the documentation should be more explicit, but I wouldn't say this is an issue. Both mkstemp and mkdtemp are low level functions which are intended to have this kind of flexibility.

The os.unlink, and the equivalent os.remove, are POSIX defined functions which always deletes the name from the filesystem but the file will remain in memory so long as there are file descriptors referencing it. So using os.close(file_descriptor) is actually how you are expected to use this API.

Is there any reason you don't want to use [Named]TemporaryFile? They are  high level interfaces which handle the cleanup.
History
Date User Action Args
2021-01-28 11:03:11StillSubjectToChangesetrecipients: + StillSubjectToChange, mieczyslaw.torchala
2021-01-28 11:03:11StillSubjectToChangesetmessageid: <1611831791.27.0.308373189642.issue42830@roundup.psfhosted.org>
2021-01-28 11:03:11StillSubjectToChangelinkissue42830 messages
2021-01-28 11:03:11StillSubjectToChangecreate