Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'tries': 0.05; 'exit': 0.07; 'subject:file': 0.07; 'naturally': 0.09; 'received:internal': 0.09; 'sys.stderr': 0.09; 'exception': 0.13; 'wed,': 0.15; 'instead.': 0.15; 'all?': 0.16; 'descriptor.': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'user?': 0.16; 'wrote:': 0.16; 'header:In-Reply-To:1': 0.24; 'error': 0.27; 'subject:/': 0.29; 'parent': 0.29; "d'aprano": 0.33; 'steven': 0.33; 'file': 0.34; 'to:addr:python-list': 0.35; 'but': 0.36; 'child': 0.36; 'received:10': 0.37; "didn't": 0.37; 'display': 0.37; 'subject:: ': 0.37; 'received:66': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'why': 0.40; 'close': 0.61; 'from:no real name:2**0': 0.61; 'header:Message-Id:1': 0.62; 'subject: & ': 0.73 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=vf1Cuh1zBn6Qfl5jKLLS4am1HiM=; b=shezy7 uB9bg1Ez5JtpHyEvRqJ7LrRGqBmqYigziwbCIlOA1xeDCrn2CB4bOqU18elG70LZ ame4DA3r+ab+l+2Quz2QP1bFGfNZG23JIP9S6ieuD/D6+z8+8oftNY7QjnqWRbhp E+e94SNtFXvzf4Jhgia6Z5h82eW0djrE4t8To= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=vf1Cuh1zBn6Qfl5 jKLLS4am1HiM=; b=N6napV1USBeaYOpwyt3Lccl7hYHTbOT9vIMjo/fzTs9y85k NsYApWCN29IlpX+2mTO3EokqtyxHtR8CfNA+a7h5dil1qmnV9+irujtTS7Yi1q/L qnxBjPIdx3Cfs9R0LEloU6NwQJ+NJpH16pf76OlCAb97CmE1x/XlTAzZOFv8= X-Sasl-Enc: VP4soS1dcrD2zX1NhYgZM0XnsiFvM767DY51UBr3uV2d 1433336050 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-073992ec In-Reply-To: <878uc1567j.fsf@elektro.pacujo.net> References: <87pp5eksnc.fsf@universite-de-strasbourg.fr.invalid> <87eglt7u5i.fsf@elektro.pacujo.net> <87lhg1lt00.fsf@universite-de-strasbourg.fr.invalid> <87a8wh7nq6.fsf@elektro.pacujo.net> <87d21dl0jc.fsf@universite-de-strasbourg.fr.invalid> <877frl6xxj.fsf@elektro.pacujo.net> <556eee15$0$12975$c3e8da3$5496439d@news.astraweb.com> <878uc1567j.fsf@elektro.pacujo.net> Subject: Re: fork/exec & close file descriptors Date: Wed, 03 Jun 2015 08:54:10 -0400 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433336055 news.xs4all.nl 2849 [2001:888:2000:d::a6]:48837 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91954 On Wed, Jun 3, 2015, at 08:25, Marko Rauhamaa wrote: > Steven D'Aprano : > > > How does the child process know what action didn't complete? What > > error message are you going to display to the user? > > You definitely must not use sys.stderr from the child process nor are > you allowed to exit through an exception but must call os._exit() > instead. Why does the child process need to report the error at all? The parent process will find out naturally when *it* tries to close the same file descriptor.