Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #90847

fork/exec & close file descriptors

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.048
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'level,': 0.07; 'subject:file': 0.07; 'restart': 0.09; 'python': 0.11; 'descriptors': 0.16; 'number?': 0.16; 'underlying': 0.16; 'library': 0.18; 'skip': 0.24; 'subject:/': 0.26; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'file': 0.32; 'stuff': 0.32; 'open': 0.33; 'bugs': 0.33; 'basic': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'dance': 0.36; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'new': 0.61; 'simply': 0.61; 'hours': 0.66; 'due': 0.66; 'subject: & ': 0.68; 'discover': 0.82
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=uvRVwBME9aNDrQCWYtWpf3GhDjQ8n5DpLiCYbHMuFjk=; b=KNGFIVMLCmhv49JvItCqPl5W0hfuNuOPQX/lLMs35Vt3Lm7pBprVXZfK6UQqAGbG9b jcPdDZ9KZBNDP8pddTCBCJ4ZjcyE1ScAWqFTc/mu8TGZBeH0zab6vYSBTCzdaZIVWG8G 8cqQotZY5oCm93HtsYJVjlD2QA26vTDK5SyJopFx2PLWYt3SD0AhoFz9usY7z68SYhCG WCMFpBXZ/YXKDE5qZX1vI74lzCaZTyv2I395Uymw/81T63CXFN3+PM0VQoExfwRuZwjc t/trVDA0KAhfX1Ubw5/qIWA3xNmz5Zt8hhW7O36EqvYlffspTbbqDcdDC46RKpMjCPRa QsuA==
MIME-Version 1.0
X-Received by 10.202.87.200 with SMTP id l191mr22725982oib.83.1432040340959; Tue, 19 May 2015 05:59:00 -0700 (PDT)
Date Tue, 19 May 2015 07:59:00 -0500
Subject fork/exec & close file descriptors
From Skip Montanaro <skip.montanaro@gmail.com>
To Python <python-list@python.org>
Content-Type multipart/alternative; boundary=001a113de566d3b6e605166edf2d
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.131.1432040344.17265.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432040344 news.xs4all.nl 2906 [2001:888:2000:d::a6]:46645
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 4142
X-Received-Body-CRC 3263753733
Xref csiph.com comp.lang.python:90847

Show key headers only | View raw


[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 comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

fork/exec & close file descriptors Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-19 07:59 -0500

csiph-web