Isaac Young <isyo...@pm.me> added the comment:
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. ---------- nosy: +StillSubjectToChange _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42830> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com