[issue10174] multiprocessing expects sys.stdout to have a fileno/close method.

Mher Movsisyan report at bugs.python.org
Fri Jan 7 23:02:55 CET 2011


Mher Movsisyan <mher.movsisyan at gmail.com> added the comment:

This bug was fixed in #5313

--- a/multiprocessing/process.py
+++ b/multiprocessing/process.py
@@ -225,7 +225,8 @@ class Process(object):
             self._children = set()
             self._counter = itertools.count(1)
             try:
-                os.close(sys.stdin.fileno())
+                sys.stdin.close()
+                sys.stdin = open(os.devnull)
             except (OSError, ValueError):
                 pass
             _current_process = self

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10174>
_______________________________________


More information about the Python-bugs-list mailing list