[New-bugs-announce] [issue13812] multiprocessing package doesn't flush stderr on child exception
report at bugs.python.org
Wed Jan 18 02:15:45 CET 2012
New submission from Jon Brandvein <jon.brandvein at gmail.com>:
When a child process exits due to an exception, a traceback is written, but stderr is not flushed. Thus I see a header like "Process 1:\n", but no traceback.
I don't have a development environment or any experience with Mecurial, so I'm afraid there's no patch, but it's a one-liner.
In /Lib/multiprocess/process.py :: Process._bootstrap
exitcode = 1
sys.stderr.write('Process %s:\n' % self.name)
Append a "sys.stderr.flush()" to the suite.
It surprised me that flushing was even necessary. I would've thought that the standard streams would all be closed just before the process terminated, regardless of exit status. But I observe that unless I explicitly flush stdout and stderr before terminating, the output is lost entirely, even if the exit is not abnormal. This isn't the desired behavior, is it?
components: Library (Lib)
title: multiprocessing package doesn't flush stderr on child exception
versions: Python 3.2, Python 3.3, Python 3.4
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce