-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
subprocess.Popen can pass incomplete environment when posix_spawn is used #113119
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
Labels
type-bug
An unexpected behavior, bug, or error
Comments
gpshead
pushed a commit
that referenced
this issue
Dec 17, 2023
…wn is used (#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.
reopened due to @ned-deily reporting on a parallel issue #113117 about this change: This breaks macOS framework builds such as those used by the python.org installer:
Note the comments elsewhere in posixmodule.c such as at line 1582:
|
gpshead
added a commit
that referenced
this issue
Dec 19, 2023
`--enable-framework` builds were failing. we apparently do not have good CI & buildbot coverage here.
Sorry for that, and thank you for the fix. Since CI was green, I didn't look into it much more and missed that. |
ryan-duve
pushed a commit
to ryan-duve/cpython
that referenced
this issue
Dec 26, 2023
`--enable-framework` builds were failing. we apparently do not have good CI & buildbot coverage here.
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
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.
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
Feb 11, 2024
`--enable-framework` builds were failing. we apparently do not have good CI & buildbot coverage here.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
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.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
`--enable-framework` builds were failing. we apparently do not have good CI & buildbot coverage here.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
Subprocess created with
posix_spawn
can have different environment when compared to a process created with stardardfork/exec
.The reason is that
posix_spawn
usesos.environ
(when no env was given), which is not affected byos.putenv
andos.unsetenv
. This is different fromexecv
, which uses process environment (available throughenviron
).This can be easily reproduced with
test_putenv_unsetenv
modified to callsubprocess.run
withclose_fds=False
(which makes it use theposix_spawn
call):I found it when I patched Python with #113118 (on Solaris, but this is pretty platform independent, I think).
CPython versions tested on:
3.9, 3.11
Operating systems tested on:
Other
Linked PRs
The text was updated successfully, but these errors were encountered: