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: Syntax error in Python3 documentation
Type: Stage: resolved
Components: Documentation Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Dennis Sweeney, docs@python, evolvah
Priority: normal Keywords:

Created on 2021-05-07 20:44 by evolvah, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg393222 - (view) Author: Sergey Maslyakov (evolvah) Date: 2021-05-07 20:44
https://docs.python.org/3/library/subprocess.html#subprocess.check_output

The code sample seems to have a misplaced closing round bracket. It should go after "stdout"

```
run(..., check=True, stdout=PIPE).stdout
```
msg393223 - (view) Author: Dennis Sweeney (Dennis Sweeney) * (Python committer) Date: 2021-05-07 20:52
I think the docs are correct. For example:

>>> import subprocess
>>> subprocess.run("ls", check=True, stdout=subprocess.PIPE).stdout
<my files here>
>>> subprocess.check_output("ls")
<my files here>
msg393224 - (view) Author: Sergey Maslyakov (evolvah) Date: 2021-05-07 20:57
Thank you, Dennis! I was wrong. Closing the ticket.
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88237
2021-05-07 20:57:28evolvahsetstatus: open -> closed
resolution: not a bug
messages: + msg393224

stage: resolved
2021-05-07 20:52:31Dennis Sweeneysetnosy: + Dennis Sweeney
messages: + msg393223
2021-05-07 20:44:44evolvahcreate