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.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
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16624>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com