Charles-François Natali <neolo...@free.fr> added the comment:

> I propose applying the following patch.

The test looks good to me (except we don't remove TESTFN explicitely,
but I'm not sure it's really necessary).

As for the patch, couldn't we put all the file stream flushing in one place?

stdout and stderr are already flushed on Unix (which explains why this
only happens on Windows: the libc puts non-tty streams in _IOFBF, so
this wouldn't work without explicit flushing neither).

Lib/multiprocessing/forking.py:Popen.__init__:
           code = process_obj._bootstrap()
           sys.stdout.flush()
           sys.stderr.flush()
           os._exit(code)

Also, there's already a flush() a couple lines above (in _bootstrap):
           sys.stderr.write(e.args[0] + '\n')
           sys.stderr.flush()

So I'd suggest to just put:

           sys.stdout.flush()
           sys.stderr.flush()

At the end of _bootstrap, and remove the flushing done by
Popen.__init__ on Unix.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13812>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to