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

Jesse Noller jnoller at gmail.com
Wed Feb 18 21:16:11 EST 2009


On Tue, Feb 17, 2009 at 10:34 PM, Graham Dumpleton
<Graham.Dumpleton at gmail.com> wrote:
> Why is the multiprocessing module, ie., multiprocessing/process.py, in
> _bootstrap() doing:
>
>  os.close(sys.stdin.fileno())
>
> rather than:
>
>  sys.stdin.close()
>
> 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.
>
> Graham
> --
> http://mail.python.org/mailman/listinfo/python-list
>

I don't know why it was implemented that way. File an issue on the
tracker and assign it to me (jnoller) please.



More information about the Python-list mailing list