This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [doc] Clarify Popen stdin, stdout, stderr
Type: Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: JelleZijlstra, Yclept.Nemo, docs@python, kumaraditya, martin.panter, miss-islington
Priority: normal Keywords: easy, patch

Created on 2016-05-01 04:32 by Yclept.Nemo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30231 merged kumaraditya, 2021-12-23 08:43
PR 31587 merged miss-islington, 2022-02-25 16:41
PR 31588 merged miss-islington, 2022-02-25 16:41
Messages (5)
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.
msg414017 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-02-25 16:41
New changeset dd69f734218ac5d3a551227069ac53ee09b0cd3e by Kumar Aditya in branch 'main':
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
https://github.com/python/cpython/commit/dd69f734218ac5d3a551227069ac53ee09b0cd3e
msg414021 - (view) Author: miss-islington (miss-islington) Date: 2022-02-25 17:03
New changeset 1f956d11dbd952fed9b214a0c6e5fd9f91a1f4ca by Miss Islington (bot) in branch '3.10':
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
https://github.com/python/cpython/commit/1f956d11dbd952fed9b214a0c6e5fd9f91a1f4ca
msg414022 - (view) Author: miss-islington (miss-islington) Date: 2022-02-25 17:07
New changeset de2c91a89aa0e89d5d01d71697d0f27a9f60c11d by Miss Islington (bot) in branch '3.9':
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
https://github.com/python/cpython/commit/de2c91a89aa0e89d5d01d71697d0f27a9f60c11d
History
Date User Action Args
2022-04-11 14:58:30adminsetgithub: 71084
2022-02-25 17:07:16miss-islingtonsetmessages: + msg414022
2022-02-25 17:03:46miss-islingtonsetmessages: + msg414021
2022-02-25 16:43:01JelleZijlstrasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-02-25 16:41:32miss-islingtonsetpull_requests: + pull_request29711
2022-02-25 16:41:29JelleZijlstrasetnosy: + JelleZijlstra
messages: + msg414017
2022-02-25 16:41:28miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request29710
2021-12-23 08:43:01kumaradityasetkeywords: + patch
nosy: + kumaraditya

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