8000 bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) by jdevries3133 · Pull Request #26755 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
< 8000 h1 class="gh-header-title mb-2 lh-condensed f1 mr-0 flex-auto wb-break-word"> bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) #26755
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 22, 2021

Conversation

jdevries3133
Copy link
Contributor
@jdevries3133 jdevries3133 commented Jun 16, 2021
  • When shell=True, subprocess will exec /bin/bash [args], for example.
  • If the program is not found, the shell will exit with a failure
    code (rather than raise an exception), and the problem may go unnoticed at first.

I added the exact sentence @ncoghlan put at the end of the bpo thread.

https://bugs.python.org/issue14879

* When shell=True, subprocess will exec /bin/bash [args], for example.
* If the program is not found, the shell will not exit with a failure
  code, and the problem may go unnoticed at first.
@@ -689,7 +689,10 @@ execute, will be re-raised in the parent.

The most common exception raised is :exc:`OSError`. This occurs, for example,
when trying to execute a non-existent file. Applications should prepare for
:exc:`OSError` exceptions.
:exc:`OSError` exceptions. Note that, when ``"shell=True"``, :exc:`OSError` will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please wrap the "will" so that the line does not exceed 80 chars.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have done that. In a separate additional commit I also went over the whole file line wrapping any other paragraphs that went over.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the separate commit - it spams the diff and makes it hard to see what you changed.

In general we don't do sweeping fixes like that, but try not to add more formatting problems with the changes we commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it's been reverted.

@iritkatriel iritkatriel changed the title bpo-14879: [doc] subprocess shell=True OSError may not be raised bpo-14879: [doc] clarify error handling with subprocess.Popen(..., shell=True) Jun 21, 2021
@iritkatriel iritkatriel changed the title bpo-14879: [doc] clarify error handling with subprocess.Popen(..., shell=True) bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) Jun 21, 2021
@iritkatriel iritkatriel requested a review from giampaolo June 21, 2021 16:01
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jul 22, 2021
@jdevries3133
Copy link
Contributor Author

@iritkatriel is there anyone else who can take a second look at this if @giampaolo is unavailable?

@iritkatriel iritkatriel merged commit 50ffbe3 into python:main Jul 22, 2021
@miss-islington
Copy link
Contributor

Thanks @jdevries3133 for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9.
🐍🍒⛏🤖

@bedevere-bot
Copy link
bedevere-bot 8000 commented Jul 22, 2021

GH-27288 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 22, 2021
…n(..., shell=True) (pythonGH-26755)

(cherry picked from commit 50ffbe3)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
@bedevere-bot
Copy link

GH-27289 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jul 22, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 22, 2021
…n(..., shell=True) (pythonGH-26755)

(cherry picked from commit 50ffbe3)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
iritkatriel pushed a commit that referenced this pull request Jul 22, 2021
…n(..., shell=True) (GH-26755) (GH-27289)

(cherry picked from commit 50ffbe3)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
iritkatriel pushed a commit that referenced this pull request Jul 22, 2021
…n(..., shell=True) (GH-26755) (GH-27288)

(cherry picked from commit 50ffbe3)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0