[issue22709] restore accepting detached stdin in fileinput binary mode

2016-01-02 Thread R. David Murray
R. David Murray added the comment: Hopefully 'better late than never' applies to this. Sigh. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue22709] restore accepting detached stdin in fileinput binary mode

2016-01-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset ded1336bff49 by R David Murray in branch '3.5': #22709: Use stdin as-is if it does not have a buffer attribute. https://hg.python.org/cpython/rev/ded1336bff49 New changeset 688d32cdbc0c by R David Murray in branch 'default': Merge: #22709: Use stdin

[issue22709] restore accepting detached stdin in fileinput binary mode

2015-12-03 Thread R. David Murray
Changes by R. David Murray : -- stage: -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread R. David Murray
R. David Murray added the comment: I actually agree that this should be applied not only for backward compatibility reasons, but because it is better duck typing. It unfortunately leaves code still having to potentially deal with "if python version is 3.4.1 or 3.4.2", but there is nothing tha

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li
Akira Li added the comment: > 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

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Serhiy Storchaka
Serhiy Storchaka 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'

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li
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*

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The code sys.stdin = sys.stdin.detach() is incorrect because sys.stdin should be text stream, but detach() returns binary stream. -- nosy: +serhiy.storchaka ___ Python tracker

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li
New submission from Akira Li: The patch for Issue #21075: "fileinput.FileInput now reads bytes from standard stream if binary mode is specified" broke code that used sys.stdin = sys.stdin.detach() with FileInput(mode='rb') in Python 3.3 I've attached the patch that makes FileInput to accept det