Richard Xia added the comment:
I'd like to provide another, non-performance-related use case for changing the
default value of Popen's close_fds parameters back to False.
In some scenarios, a (non-Python) parent process may want its descendant
processes to inherit a parti
Richard Xia added the comment:
Thanks for the discussion. I ended up doing something similar to the code
snippet Christian posted, except I also had a second try/except
FileNotFoundError within the original finally block to catch the case that
David pointed out.
In retrospect, I probably
New submission from Richard Xia:
Here is a very short program to demonstrate what I'm seeing:
>>> import tempfile
>>> import os
>>> with tempfile.NamedTemporaryFile(delete=True) as fp:
... print(fp.name)
... os.system('rm {}'.format(fp.name))