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

2021-07-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: Mieczysław: perfect, thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

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

2021-07-09 Thread Mieczysław Torchała
Mieczysław Torchała added the comment: Hi Andrei! In my case it was: OSError: [Errno 24] Too many open files -- ___ Python tracker ___ __

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

2021-07-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: Can someone w/access to a Linux system confirm if running out of FDs raises an OSError? Something like this: N = `ulimit -n` + 5 for x in range(N): tempfile.mkstemp() -- ___ Python tracker

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

2021-07-08 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) added the comment: I have raised a docs PR. -- ___ Python tracker ___ ___

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

2021-07-08 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Change by Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) : -- keywords: +patch nosy: +thatiparthy nosy_count: 3.0 -> 4.0 pull_requests: +25625 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27075 ___ Python tra

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

2021-07-08 Thread Andrei Kulakov
Andrei Kulakov 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

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

2021-01-28 Thread Mieczysław Torchała
Mieczysław Torchała added the comment: Yes, having it written explicitly in docs (that remove means not only a file removal with unlink/remove and warn about lacking file descriptors), or/and providing a remove function in tempfile which will both unlink and close, would be valuable. The use

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

2021-01-28 Thread Isaac Young
Isaac Young 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 function

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

2021-01-05 Thread Mieczysław Torchała
New submission from Mieczysław Torchała : tempfile mkstemp() documentation says: "Unlike TemporaryFile(), the user of mkstemp() is responsible for deleting the temporary file when done with it." mkstemp() returns a tuple: file_descriptor, file_path = mkstemp() Calling only os.unlink(file_pa