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 BreamoreBoy, serhiy.storchaka, zwol
Date 2013-04-18.18:19:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1366309197.54.0.261053983877.issue16624@psf.upfronthosting.co.za>
In-reply-to
Content
I think that it will be better not introduce a new argument, but reuse stdin. Just allow io.BytesIO (or perhaps even any file object) be specified as stdin.

The change will be straightforward:

if isinstance(stdin, io.BytesIO):
    inputdata = stdin.read()
    stdin = PIPE

Or more general:

if not(stdin is None or stdin in (PIPE, DEVNULL) or isinstance(stdin, int)):
    try:
        stdin.fileno()
    except (AttributeError, UnsupportedOperation, OSError):
        inputdata = stdin.read()
        stdin = PIPE
History
Date User Action Args
2013-04-18 18:19:57serhiy.storchakasetrecipients: + serhiy.storchaka, BreamoreBoy, zwol
2013-04-18 18:19:57serhiy.storchakasetmessageid: <1366309197.54.0.261053983877.issue16624@psf.upfronthosting.co.za>
2013-04-18 18:19:57serhiy.storchakalinkissue16624 messages
2013-04-18 18:19:57serhiy.storchakacreate