GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-113119 fix environment handling in subprocess.Popen when posix_spawn is used by kulikjak · Pull Request #113120 · python/cpython

Conversation

@kulikjak

@kulikjak kulikjak commented Dec 14, 2023 •
edited by gpshead
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: subprocess.Popen can pass incomplete environment when posix_spawn is used #113119

Fixes #113119 .


📚 Documentation preview 📚: https://cpython-previews--113120.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kulikjak added 2 commits December 14, 2023 11:17
@kulikjak
Allow posix_spawn to inherit environment form parent environ variable.
0abca34
With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
@kulikjak
Add documentation
8c0974c
@kulikjak
kulikjak requested a review from gpshead as a code owner December 14, 2023 15:51
@bedevere-app bedevere-app Bot added the awaiting review label Dec 14, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Dec 14, 2023
subprocess.Popen can pass incomplete environment when posix_spawn is used #113119
Closed
gpshead
gpshead reviewed Dec 15, 2023
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The code looks good, can you add a NEWS entry (step 8 in https://devguide.python.org/) and mention the os.posix_spawn feature of accepting env=None to mean "use the current process environment" in Doc/whatsnew/3.13.rst?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gpshead gpshead self-assigned this Dec 15, 2023
@kulikjak
Add NEWS fragment and whatsnew/3.13 entry
c321f35
@kulikjak

kulikjak commented Dec 16, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I added a NEWS fragment and whatsnew entry as per your suggestion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead
gpshead approved these changes Dec 17, 2023
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Dec 17, 2023
@gpshead
Merge branch 'main' into posix_spawn-fix-environment
bceeb7a
@gpshead
gpshead enabled auto-merge (squash) December 17, 2023 04:54
@gpshead
remove trailing whitespace
ade82f1
@gpshead
gpshead disabled auto-merge December 17, 2023 04:56
@gpshead
gpshead enabled auto-merge (squash) December 17, 2023 04:56
@gpshead
gpshead merged commit 48c907a into python:main Dec 17, 2023
@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 17, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@kulikjak @aisk
pythongh-113119 fix environment handling in subprocess.Popen when pos…
bd6de62
…ix_spawn is used (python#113120)

* Allow posix_spawn to inherit environment form parent environ variable.

With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@kulikjak @Glyphack
pythongh-113119 fix environment handling in subprocess.Popen when pos…
3ea4a9f
…ix_spawn is used (python#113120)

* Allow posix_spawn to inherit environment form parent environ variable.

With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
johnslavik added a commit to johnslavik/typeshed that referenced this pull request Dec 7, 2025
@johnslavik
Annotate env in posix_spawn as optional
8625e0f
`env` can be `None` since 3.13, see python/cpython#113120
@johnslavik johnslavik mentioned this pull request Dec 7, 2025
Annotate env in os.posix_spawn as optional python/typeshed#15110
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gpshead gpshead

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

subprocess.Popen can pass incomplete environment when posix_spawn is used

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kulikjak @gpshead
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.