Speeding up Python's exit

Jason Swails jason.swails at gmail.com
Fri Mar 1 21:51:52 EST 2013


On Fri, Mar 1, 2013 at 5:51 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> Dave Angel <davea <at> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130301/591866a1/attachment.html>


More information about the Python-list mailing list