A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-January/115397.html below:

[Python-Dev] A question about the subprocess implementation

[Python-Dev] A question about the subprocess implementation [Python-Dev] A question about the subprocess implementationPhil Vandry vandry at TZoNE.ORG
Sun Jan 8 03:28:56 CET 2012
On 2012-01-08 10:48 , Vinay Sajip wrote:
> Terry Reedy<tjreedy<at>  udel.edu>  writes:
>> The behavior matches the doc: Popen.stdin
>> If the stdin argument was PIPE, this attribute is a file object that
>> provides input to the child process. Otherwise, it is None.
>
> Right, but it's not very helpful, nor especially intuitive. Why does it have to
> be None in the case where you pass in a file object? Is there some benefit to be
> gained by doing this? Does something bad happen if you store that file object in
> proc.stdin / proc.stdout / proc.stderr?

proc.stdin, proc.stdout, and proc.stderr aren't meant to be a reference 
to the file that got connected to the subprocess' stdin/stdout/stderr. 
They are meant to be a reference to the OTHER END of the pipe that got 
connected. When you pass in a normal file object there is no such thing 
as the OTHER END of that file. The value None reflects this fact, and 
should continue to do so.

-Phil
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4