Marko Rauhamaa <[email protected]>: > input() quite naturally can raise an IOError. For example: > > import os, socket > s = socket.socket(socket.AF_UNIX) > s.bind("xyz") > os.dup2(s.fileno(), 0); print(input()) > > results in an IOError (EINVAL, to be exact).
Even simpler:
>>> import os
>>> os.close(0); input()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 9] Bad file descriptor
Marko
--
https://mail.python.org/mailman/listinfo/python-list
