I tried this:
Python 3.2.2 (default, Feb 24 2012, 20:07:04) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> import io >>> fh = io.open(sys.stdin) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: invalid file: <_io.TextIOWrapper name='<stdin>' mode='r' encoding='UTF-8'> >>> fh = io.open(sys.stdin, "rb") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: invalid file: <_io.TextIOWrapper name='<stdin>' mode='r' encoding='UTF-8'> -- http://mail.python.org/mailman/listinfo/python-list