multiprocessing module and os.close(sys.stdin.fileno())

Graham Dumpleton Graham.Dumpleton at
Tue Feb 17 22:34:39 EST 2009

Why is the multiprocessing module, ie., multiprocessing/, in
_bootstrap() doing:


rather than:


Technically it is feasible that stdin could have been replaced with
something other than a file object, where the replacement doesn't have
a fileno() method.

In that sort of situation an AttributeError would be raised, which
isn't going to be caught as either OSError or ValueError, which is all
the code watches out for.


More information about the Python-list mailing list