Akira Li added the comment: It is incorrect that sys.stdin is *always* a text stream. It often is, but not always.
There are cases when it is not e.g., $ tar zcf - stuff | gpg -e | ssh user@server 'cat - > stuff.tar.gz.gpg' tar's stdout is *not* a text stream. gpg's stdin/stdout are *not* text streams. ssh's stdin is *not* a text stream. etc. If any of the steps are implemented in Python then it is useful to consider sys.stdin as a binary stream. Any script written before Python 3.4.1 (#21075) that used FileInput binary mode *had to* use sys.stdin = sys.stdin.detach() A bugfix release should not break working code. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22709> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com