Serhiy Storchaka added the comment:

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 = PIPE

Or more general:

if not(stdin is None or stdin in (PIPE, DEVNULL) or isinstance(stdin, int)):
    except (AttributeError, UnsupportedOperation, OSError):
        inputdata =
        stdin = PIPE


Python tracker <>
Python-bugs-list mailing list

Reply via email to