[issue16624] subprocess.check_output should allow specifying stdin as a string

Zack Weinberg report at bugs.python.org
Thu Apr 18 20:39:34 CEST 2013


Zack Weinberg added the comment:

Note also that allowing `stdin=<any filelike>` in a clean fashion would require rather more surgery than you suggest, because a filelike can produce an infinite stream of data, and people would expect that to work when the subprocess only reads a finite prefix; making it *actually* work would involve teaching communicate() to take a filelike and copy blocks into the pipe.  I have no *objection* to that change but I think it is too much mission creep for this proposal.

With the present design, where stdin= has to be something for which fileno() is defined, and input= has to be a string (hence of finite length), no one is going to expect something to work that won't.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16624>
_______________________________________


More information about the Python-bugs-list mailing list