classification
Title: [doc] Clarify Popen stdin, stdout, stderr
Type: Stage: patch review
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Yclept.Nemo, docs@python, kumaraditya303, martin.panter
Priority: normal Keywords: easy, patch

Created on 2016-05-01 04:32 by Yclept.Nemo, last changed 2021-12-23 08:43 by kumaraditya303.

Pull Requests
URL Status Linked Edit
PR 30231 open kumaraditya303, 2021-12-23 08:43
Messages (2)
msg264579 - (view) Author: Yclept Nemo (Yclept.Nemo) Date: 2016-05-01 04:32
From: https://docs.python.org/dev/library/subprocess.html#popen-constructor

"..., an existing file descriptor (a positive integer), an existing file object, and None."

It should be made clear that the file object must be backed by an operating system file, i.e. must have a valid file descriptor.

As it stands, the documentation suggests implicit concurrency: that any file object can be used, and on read/write from the subprocess/OS arbitrary python code will be executed, i.e. the python interpreter is pre-empted or python spawns a hidden I/O thread.

Anyway, I'm pretty sure subprocess.Popen() just redirects the forked process' stdout/stdin/stderr to the file descriptors from the provided file object.
msg265052 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-05-07 08:51
Yes, in all cases I understand it is just the file descriptor that matters. Perhaps any documentation update could also take Issue 24358 into account, which points out that compressed and buffered file object wrappers also cause inconsistencies in the data at the high-level file object and the OS-level file descriptor.
History
Date User Action Args
2021-12-23 08:43:01kumaraditya303setkeywords: + patch
nosy: + kumaraditya303

pull_requests: + pull_request28459
stage: needs patch -> patch review
2021-12-05 17:06:55iritkatrielsetkeywords: + easy
title: Clarify Popen stdin, stdout, stderr -> [doc] Clarify Popen stdin, stdout, stderr
versions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.5, Python 3.6
2016-05-07 08:51:45martin.pantersetversions: + Python 2.7, Python 3.5
nosy: + martin.panter

messages: + msg265052

stage: needs patch
2016-05-01 04:32:17Yclept.Nemocreate