FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

subprocess: close pipes/fds by using ExitStack by giampaolo · Pull Request #11686 · python/cpython · GitHub

/ cpython Public

subprocess: close pipes/fds by using ExitStack - #11686

Merged
gpshead merged 4 commits into
python:masterfrom
giampaolo:subprocess_spawn_exitstack
Jan 29, 2019
Merged

subprocess: close pipes/fds by using ExitStack#11686
gpshead merged 4 commits into
python:masterfrom
giampaolo:subprocess_spawn_exitstack

Conversation

giampaolo commented Jan 27, 2019
edited by gpshead
Loading

Copy link
Copy Markdown
Contributor

"In case of premature failure on X.Close() or os.close(X) the remaining pipes/fds will remain "open". Perhaps it makes sense to use contextlib.ExitStack."

This is a follow up of bpo-35537. Rationale of this change originated during code inspection in #11575 (comment).

Comment thread Lib/subprocess.py Outdated

gpshead commented Jan 27, 2019
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

I suggest adding the following as a NEWS entry:

"An ExitStack is now used internally within subprocess.POpen to clean up pipe file handles. No behavior change in normal operation. But if closing one handle were ever to cause an exception, the others will now be closed instead of leaked."

I tried, but the blurbit web UI wouldn't let me add it to this PR.
reuse the bpo-35537 issue number, no good reason to file an issue specifically for this minor fix.

gpshead merged commit bafa848 into python:master Jan 29, 2019
giampaolo deleted the subprocess_spawn_exitstack branch February 3, 2019 22:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL