Message89523
Please do this:
--- 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
One shouldn't close the fileno after the file has been closed. The
stdlib raises an error, and the open(os.devnull) won't be reached. If no
error was thrown, it would be worse. This would be closing a fileno that
doesn't belong to sys.stdin anymore and may be used somewhere else.
The open(os.devnull) bit is both so that no one tries to do anything
with the old stdin anymore, and to let applications attempt to read from
stdin without an IOError. |
|
Date |
User |
Action |
Args |
2009-06-19 15:55:26 | OG7 | set | recipients:
+ OG7, jnoller, grahamd, ptn, i000 |
2009-06-19 15:55:26 | OG7 | set | messageid: <1245426926.05.0.964162416741.issue5313@psf.upfronthosting.co.za> |
2009-06-19 15:55:24 | OG7 | link | issue5313 messages |
2009-06-19 15:55:23 | OG7 | create | |
|