Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #90847 > unrolled thread
| Started by | Skip Montanaro <skip.montanaro@gmail.com> |
|---|---|
| First post | 2015-05-19 07:59 -0500 |
| Last post | 2015-05-19 07:59 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
fork/exec & close file descriptors Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-19 07:59 -0500
| From | Skip Montanaro <skip.montanaro@gmail.com> |
|---|---|
| Date | 2015-05-19 07:59 -0500 |
| Subject | fork/exec & close file descriptors |
| Message-ID | <mailman.131.1432040344.17265.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
Due to presumed bugs in an underlying library over which I have no control, I'm considering a restart in the wee hours of the morning. The basic fork/exec dance is not a problem, but how do I discover all the open file descriptors in the new child process to make sure they get closed? Do I simply start at fd 3 and call os.close() on everything up to some largish fd number? Some of these file descriptors will have been opened by stuff well below the Python level, so I don't know them a priori. Thx, Skip
Back to top | Article view | comp.lang.python
csiph-web