Skip to content

gh-113119 fix environment handling in subprocess.Popen when posix_spawn is used #113120

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
Dec 17, 2023

Conversation

kulikjak
Copy link
Contributor

@kulikjak kulikjak commented Dec 14, 2023

With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
Copy link
Member

@gpshead gpshead left a 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?

@gpshead gpshead self-assigned this Dec 15, 2023
@kulikjak
Copy link
Contributor Author

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

@gpshead gpshead enabled auto-merge (squash) December 17, 2023 04:54
@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
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…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
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

subprocess.Popen can pass incomplete environment when posix_spawn is used
2 participants