[issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called

Andrei Kulakov report at bugs.python.org
Thu Jul 8 22:02:18 EDT 2021


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

It seems reasonable to add a paragraph like:

    If a large number of file descriptors are created, your program may run into a per-process limit. You can avoid this issue by closing file descriptors with :func:`os.close`.

I also noticed that `mkstemp` doc refers to file handles, but links to `os.open` which uses 'file descriptors'. It may be good if along with this change, existing text was updated to refer to 'file descriptors'.

----------
nosy: +andrei.avk

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


More information about the Python-bugs-list mailing list