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


Groups > comp.lang.python > #91916

Re: fork/exec & close file descriptors

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.039
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'subject:file': 0.07; 'descriptor': 0.09; 'underlying': 0.09; 'python': 0.11; 'descriptors': 0.16; 'folks,': 0.16; 'skip': 0.18; 'are.': 0.22; 'libraries': 0.22; 'header:In-Reply-To:1': 0.24; 'idea': 0.26; 'message-id:@mail.gmail.com': 0.28; 'this.': 0.28; 'subject:/': 0.29; "i'm": 0.29; 'sense': 0.29; 'code': 0.31; 'surprised': 0.33; 'open': 0.33; 'file': 0.34; 'received:google.com': 0.34; 'that,': 0.34; 'to:addr:python-list': 0.35; 'attempt': 0.35; 'c++': 0.35; 'level.': 0.36; "didn't": 0.37; 'turn': 0.37; 'subject:: ': 0.37; 'beyond': 0.37; 'done.': 0.37; 'to:addr:python.org': 0.39; 'sure': 0.40; 'why': 0.40; 'some': 0.40; 'addition': 0.60; 'more': 0.62; 'subject: & ': 0.73; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=LfOcFF/ORb4nk1a8hg1xAz7DKvkeJJdphD4RB1N4/7w=; b=0XUZCW9d06pJhv76ir7srPhSb2Uzv1sfznQnut4nIly9JA0C3GeTTlL6nE4OoLTF4p qPe/ZEw9VvW5ie2PR/0KwfEGmcIxQl0MLn2XEkDjDZWdzcj6e53yD278bugDnYiEoJFQ c9RjAaVDR2zcLKHsLszTDwrJnFAbUbBUII2hYawpaW8lgJBPHDYZlRSlI37kZlYAkPa7 sREsDb+Pogj7nfvSIntSgArZHCQ3Kjgw6vbdsy63iwsk0gInNkYE2O5dkhWxLghrutl3 oYJnFPjS6KhObi7kZnuUCHz/7K/qDTzxaHWPKgrUwN4pjL4u2wqOKYbO9glW/KI9dvd8 flPQ==
MIME-Version 1.0
X-Received by 10.202.137.78 with SMTP id l75mr5246956oid.110.1433294466755; Tue, 02 Jun 2015 18:21:06 -0700 (PDT)
In-Reply-To <CAPTjJmpujtP5AKdFJUSx_NS7R_zddR-nEiL6Srt5B8tM2D2vZQ@mail.gmail.com>
References <CANc-5UyeaWqThGFSAuGskz+S2Lrgq0ia9W9DHAie28t9GY+sww@mail.gmail.com> <mailman.59.1433253538.13271.python-list@python.org> <87pp5eksnc.fsf@universite-de-strasbourg.fr.invalid> <87eglt7u5i.fsf@elektro.pacujo.net> <87lhg1lt00.fsf@universite-de-strasbourg.fr.invalid> <CAPTjJmpujtP5AKdFJUSx_NS7R_zddR-nEiL6Srt5B8tM2D2vZQ@mail.gmail.com>
Date Tue, 2 Jun 2015 20:21:06 -0500
Subject Re: fork/exec & close file descriptors
From Skip Montanaro <skip.montanaro@gmail.com>
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.88.1433294470.13271.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1433294470 news.xs4all.nl 2848 [2001:888:2000:d::a6]:52574
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 3882
X-Received-Body-CRC 1561075940
Xref csiph.com comp.lang.python:91916

Show key headers only | View raw


Folks, I'm not interested in rehashing this. I don't know what all the
open file descriptors are. Some/many/most will have been opened by
underlying C++ libraries and will not have been opened by code at the
Python level. I do think the addition of an os.fsync() attempt on each
file descriptor before calling os.close() makes some sense to me.
Beyond that, I'm not sure there's more that can be done.

I sent my last message simply because I was surprised os.closerange()
existed. I have no idea why it didn't turn up in my original
searching.

Skip

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: fork/exec & close file descriptors Skip Montanaro <skip.montanaro@gmail.com> - 2015-06-02 08:58 -0500
  Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-02 18:28 +0300
    Re: fork/exec & close file descriptors Skip Montanaro <skip.montanaro@gmail.com> - 2015-06-02 10:42 -0500
      Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-02 19:24 +0300
        Re: fork/exec & close file descriptors Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-06-02 16:37 +0000
    Re: fork/exec & close file descriptors MrJean1 <MrJean1@gmail.com> - 2015-06-12 13:43 -0700
  Re: fork/exec & close file descriptors Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-06-02 17:59 +0200
    Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-02 23:05 +0300
      Re: fork/exec & close file descriptors Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-06-02 23:06 +0200
        Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 01:24 +0300
          Re: fork/exec & close file descriptors Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-06-03 09:21 +0200
            Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 10:41 +0300
              Re: fork/exec & close file descriptors alister <alister.nospam.ware@ntlworld.com> - 2015-06-03 09:38 +0000
                Re: fork/exec & close file descriptors Steven D'Aprano <steve@pearwood.info> - 2015-06-03 22:07 +1000
                Re: fork/exec & close file descriptors alister <alister.nospam.ware@ntlworld.com> - 2015-06-03 12:18 +0000
                Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 15:27 +0300
                Re: fork/exec & close file descriptors alister <alister.nospam.ware@ntlworld.com> - 2015-06-03 13:05 +0000
                Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 17:49 +0300
                Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 15:25 +0300
                Re: fork/exec & close file descriptors random832@fastmail.us - 2015-06-03 08:54 -0400
                Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 16:08 +0300
                Re: fork/exec & close file descriptors random832@fastmail.us - 2015-06-03 09:21 -0400
                Re: fork/exec & close file descriptors Chris Angelico <rosuav@gmail.com> - 2015-06-03 23:32 +1000
                Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 16:33 +0300
                Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 17:43 +0300
                Re: fork/exec & close file descriptors random832@fastmail.us - 2015-06-03 16:08 -0400
                Re: fork/exec & close file descriptors Marko Rauhamaa <marko@pacujo.net> - 2015-06-04 00:09 +0300
                Re: fork/exec & close file descriptors random832@fastmail.us - 2015-06-03 16:07 -0400
                Re: fork/exec & close file descriptors Chris Angelico <rosuav@gmail.com> - 2015-06-04 07:54 +1000
        Re: fork/exec & close file descriptors Chris Angelico <rosuav@gmail.com> - 2015-06-03 09:54 +1000
          Re: fork/exec & close file descriptors Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-06-03 09:11 +0200
            Re: fork/exec & close file descriptors random832@fastmail.us - 2015-06-03 08:21 -0400
              Re: fork/exec & close file descriptors Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-06-03 15:16 +0200
        Re: fork/exec & close file descriptors Skip Montanaro <skip.montanaro@gmail.com> - 2015-06-02 20:21 -0500

csiph-web