Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!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; 'interpreter': 0.04; 'subject:Python': 0.05; '*not*': 0.07; 'terminated': 0.07; 'python': 0.09; 'exits': 0.09; 'flush': 0.09; "object's": 0.09; 'cc:addr:python-list': 0.10; '(via': 0.16; 'antoine': 0.16; 'flushed': 0.16; 'pitrou': 0.16; 'posix': 0.16; 'wrote:': 0.17; 'pointed': 0.17; 'do.': 0.21; 'cc:2**0': 0.23; '>': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'so.': 0.24; 'linux': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'appear': 0.26; 'disk': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'buffers': 0.29; 'writes:': 0.29; 'fri,': 0.30; 'file': 0.32; "can't": 0.34; 'received:google.com': 0.34; 'jason': 0.35; 'pm,': 0.35; 'really': 0.36; 'depends': 0.36; "didn't": 0.36; 'best,': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'sure': 0.38; 'system.': 0.39; 'called': 0.39; 'behavior': 0.64; '2013': 0.84; 'observed': 0.84; 'angel': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=fHhT/vjWfg92QNRn+SC7qcdoxAAS+F+wTA+jXhSHqs4=; b=iGunS0UtdHpsN8uaZYr2EW4BSTx+5AZCZpD6NX3zAMGPqrcnOuPS859ij9SkxgAulO E2G441eTRYE4HqZgkL6OeG9g2aA3enfI0+VSz0FtUe3TpbM4X9AtzZ5vERFkgcbqV7Is aCKyK+qRukbBlu+ilYbDNIlk/2j6m0DPgH7I0UNtN8qO62zGhQdHNQWADdbyGpf0FJJ1 o8JKkifRYVIc4jyxvhPPy2OxiQ7Rl1FpKb3OFDPn1Vp6afhOu+tzw8dR9Nod2dl6JoQC SvkHgltHxBygK+zllegU0HtLakvOxruyIE0dKjk2RgL7FAs9Z0Z47CvIQh7V7X1PSsm1 Bu7w== MIME-Version: 1.0 X-Received: by 10.42.67.10 with SMTP id r10mr9894588ici.7.1362192712221; Fri, 01 Mar 2013 18:51:52 -0800 (PST) In-Reply-To: References: <512f8aa9$0$30001$c3e8da3$5496439d@news.astraweb.com> <5130FED1.6060302@davea.name> Date: Fri, 1 Mar 2013 21:51:52 -0500 Subject: Re: Speeding up Python's exit From: Jason Swails To: Antoine Pitrou Content-Type: multipart/alternative; boundary=20cf3030bd29ba4e9704d6e83490 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 60 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362192720 news.xs4all.nl 6901 [2001:888:2000:d::a6]:50432 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40313 --20cf3030bd29ba4e9704d6e83490 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Mar 1, 2013 at 5:51 PM, Antoine Pitrou wrote: > Dave Angel davea.name> writes: > > > > Note he didn't say the python buffers would be flushed. It's the OS > > buffers that are flushed. > > Now please read my message again. The OS buffers are *not* flushed > according > to POSIX. > I have observed this behavior on some Linux systems with a Fortran program that terminated abnormally (via a kill signal). Other Linux systems I've used appear to flush their file buffers to disk in the event of a kill signal, it really depends on the system. If a file object's destructor is not called when the Python interpreter exits and it's up to the OS to flush the file buffers to disk, you can't be sure that it will do so. And as Antoine pointed out, POSIX standard doesn't require that they do. All the best, Jason --20cf3030bd29ba4e9704d6e83490 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Fri, M= ar 1, 2013 at 5:51 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
Dave Angel <davea <a= t> davea.name> wr= ites:
>
> Note he didn't say the python buffers would be flushed. =A0It'= s the OS
> buffers that are flushed.

Now please read my message again. The OS buffers are *not* flushed ac= cording
to POSIX.

I have observed this behavior= on some Linux systems with a Fortran program that terminated abnormally (v= ia a kill signal). =A0Other Linux systems I've used appear to flush the= ir file buffers to disk in the event of a kill signal, it really depends on= the system. =A0

If a file object's destructor is not called when th= e Python interpreter exits and it's up to the OS to flush the file buff= ers to disk, you can't be sure that it will do so. =A0And as Antoine po= inted out, POSIX standard doesn't require that they do.

All the best,
Jason
--20cf3030bd29ba4e9704d6e83490--