This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vilnis.termanis
Recipients vilnis.termanis
Date 2010-03-04.15:27:04
SpamBayes Score 2.666947e-08
Marked as misclassified No
Message-id <1267716428.75.0.581894623963.issue8056@psf.upfronthosting.co.za>
In-reply-to
Content
Affects Win32 only (tested under Ubuntu 9.10-64 and XP-32 with v2.6.4). If script output is piped, child processes created via multiprocessing.Process cannot write to stdout. Also, trying to call stdout.flush() in child processes causes IOError.

Normal behaviour
----------------
C:\>stdout.py
[Parent] stdout: <open file '<stdout>', mode 'w' at 0x00A54070>
[Parent] message via stdout

[Child] stdout: <open file '<stdout>', mode 'w' at 0x00A54070>
[Child] message via stdout

Piped behaviour (same result if redirecting to file)
---------------
C:\>stdout.py | cat
[Parent] stdout: <open file '<stdout>', mode 'w' at 0x00A54070>
[Parent] message via stdout

[Child] stdout: <open file '<stdout>', mode 'w' at 0x00A54070>
Process Process-1:
Traceback (most recent call last):
  File "C:\Python26\lib\multiprocessing\process.py", line 232, in _bootstrap
    self.run()
  File "C:\Python26\lib\multiprocessing\process.py", line 88, in run
    self._target(*self._args, **self._kwargs)
  File "C:\stdout.py", line 18, in child
    stdout.flush()
IOError: [Errno 9] Bad file descriptor
History
Date User Action Args
2010-03-04 15:27:08vilnis.termanissetrecipients: + vilnis.termanis
2010-03-04 15:27:08vilnis.termanissetmessageid: <1267716428.75.0.581894623963.issue8056@psf.upfronthosting.co.za>
2010-03-04 15:27:06vilnis.termanislinkissue8056 messages
2010-03-04 15:27:05vilnis.termaniscreate