On Mon, Jun 18, 2012 at 4:13 PM, Jason Friedman <ja...@powerpull.net> wrote: > 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'> > --
You want to read from sys.stdin.buffer -- http://mail.python.org/mailman/listinfo/python-list