On Sat, Mar 31, 2012 at 6:06 AM, Serhiy Storchaka <storch...@gmail.com> wrote: > 28.03.12 21:13, Heiko Wundram написав(ла): > >> Reading from stdin/a file gets you bytes, and >> not a string, because Python cannot automagically guess what format the >> input is in. > > > In Python3 reading from stdin gets you string. Use sys.stdin.buffer.raw for > access to byte stream. And reading from file opened in text mode gets you > string too.
True. But that's only if it's been told the encoding of stdin (which I believe is the normal case on Linux). It's still not "automagically guess(ing)", it's explicitly told. ChrisA -- http://mail.python.org/mailman/listinfo/python-list