Title: Opaque default value for close_fds argument in Popen.__init__
Type: Stage: patch review
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: danishprakash, docs@python, martin.panter, taleinat, Алексей Аверченко
Priority: normal Keywords: easy, patch

Created on 2017-10-19 20:34 by Алексей Аверченко, last changed 2018-12-08 14:59 by danishprakash.

Pull Requests
URL Status Linked Edit
PR 11039 open danishprakash, 2018-12-08 14:59
Messages (5)
msg304642 - (view) Author: Алексей Аверченко (Алексей Аверченко) Date: 2017-10-19 20:34
[11:30:03 ~]$ python
Python 3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> help(subprocess.Popen.__init__)
Help on function __init__ in module subprocess:

__init__(self, args, bufsize=-1, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=<object object at 0x10df99150>, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=(), *, encoding=None, errors=None)
    Create new Popen instance.
msg314413 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-03-25 13:47
The close_fds=<object . . .> in that signature seems fine to me. If you read the documentation, it says the default mode depends on the platform, and on other parameters. However I think the signature at <> should not show close_fds=True, because that is not necessarily the default on Windows.

It seems the default on Windows was changed to always True in 3.7, making it consistent across platforms and other parameters, thanks to Issue 19764. But the 3.7 documentation is quirky. “Changed in version 3.2: The default for ‘close_fds’ was changed from False to what is described above” refers to the 3.7 default when it was meant to refer to the 3.2–3.6 default.
msg322354 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-07-25 14:03
ISTM that the docs need to be fixed for both 3.7+ and for 3.6.

The signature is indeed awkward for 3.6, but it's too minor a detail to address considering it's no longer relevant for 3.7 and later.
msg330297 - (view) Author: Danish Prakash (danishprakash) * Date: 2018-11-23 03:17
I'd like to work on this.

I get that the 3.7+ doc still has the irrelevant change from 3.6 which needs to be removed but I'm not sure what's wrong with the 3.6 doc.

> The signature is indeed awkward for 3.6,
msg330298 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-11-23 05:13
Danish, see Martin's previous comment (msg314413):

"... the signature at [the 3.6 docs] should not show close_fds=True, because that is not necessarily the default on Windows."
Date User Action Args
2018-12-08 14:59:08danishprakashsetkeywords: + patch
stage: patch review
pull_requests: + pull_request10276
2018-11-23 05:13:27taleinatsetmessages: + msg330298
2018-11-23 03:17:01danishprakashsetnosy: + danishprakash
messages: + msg330297
2018-07-25 14:03:57taleinatsetassignee: docs@python
components: + Documentation, - Library (Lib)
versions: + Python 3.7, Python 3.8
keywords: + easy
nosy: + docs@python, taleinat

messages: + msg322354
2018-03-25 13:47:31martin.pantersetnosy: + martin.panter
messages: + msg314413
2017-10-19 20:34:16Алексей Аверченкоcreate