Message187277
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 |
|
Date |
User |
Action |
Args |
2013-04-18 18:19:57 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, BreamoreBoy, zwol |
2013-04-18 18:19:57 | serhiy.storchaka | set | messageid: <1366309197.54.0.261053983877.issue16624@psf.upfronthosting.co.za> |
2013-04-18 18:19:57 | serhiy.storchaka | link | issue16624 messages |
2013-04-18 18:19:57 | serhiy.storchaka | create | |
|