This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients akira, serhiy.storchaka
Date 2014-10-23.11:49:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <2532207.LoaQVbPTmF@raxxla>
In-reply-to <1414063581.74.0.138772319327.issue22709@psf.upfronthosting.co.za>
Content
> 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.

This is not related to Python. Terms "character", "string", "text", "file" can 
have different meaning in different domains. In Python we use Python 
terminology. There is no such thing as sys.stdin in Posix-compatible shell, 
because Posix-compatible shell has no the sys module and doesn't use a dot to 
access attributes.

> 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.

Correct solution in this case would be to use the workaround "sys.stdin = 
sys.stdin.detach()" conditionally, only in Python versions which have a bug.
History
Date User Action Args
2014-10-23 11:49:35serhiy.storchakasetrecipients: + serhiy.storchaka, akira
2014-10-23 11:49:35serhiy.storchakalinkissue22709 messages
2014-10-23 11:49:35serhiy.storchakacreate