When I have replaced sys.stdin with my own file-like object and I try to do a multiprocessing.Pool(processes=x) I get errors about sys.stdin not having a fileno or close method. For at least fileno it is described in the docs (http://docs.python.org/library/stdtypes.html#file-objects) that if your object is not a real file you should not implement it. This happens to me on Mac OS X, I will add the traceback a bit later as I am currently not on my Mac.
Please add the traceback, I can't seem to find any obvious places where this would happen now. Also, what version are you currently using? I agree with the fileno, but I'd say close is a reasonable method to implement, especially for stdin/stdout/stderr
The reported error is only reproducible in 2.6 Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> import multiprocessing >>> class A:pass ... >>> sys.stdin=A() >>> p=multiprocessing.Pool(processes=2) Process PoolWorker-1: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py", line 223, in _bootstrap Process PoolWorker-2: Traceback (most recent call last): os.close(sys.stdin.fileno()) AttributeError: A instance has no attribute 'fileno' >>> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/process.py", line 223, in _bootstrap os.close(sys.stdin.fileno()) AttributeError: A instance has no attribute 'fileno'