-
Notifications
You must be signed in to change notification settings - Fork 3.1k
"pip freeze" conflates git stdout and stderr #8191
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
Comments
Is this a variant of #7545? |
Looks like it is; I didn't catch that one while searching. |
Let’s use #7545 as the canonical tracking issue, since it contains more discussion on this issue. I’ve also edited its title to reflect this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Environment
Description
pip freeze
runsgit
under some circumstances. When it does, winds up callingsubprocess.Popen
withstderr=subprocess.STDOUT
, capturing stderr as well as stdout, which potentially leads to failures to parse the output reported bygit
on stdout.Expected behavior
stderr
is ignored except as needed to report diagnostic information, and only the output sent to stdout is parsed bypip
.How to Reproduce
Output
Where we encountered this bug, it wasn't because of the
GIT_TRACE
debugging environment variable - it was because of a warning being printed by the dynamic linker to warn us that the version oflibz.so
being picked up by thegit
binary didn't match the version it was built against (roughly this).GIT_TRACE
just makes for a convenient way to reproduce the issue; diagnostics printed to stderr are being confused with command output and mistakenly parsed.Some historical context: it looks like
call_subprocess
was updated to passstderr=subprocess.STDOUT
about 6 years ago in 0cb2991, in order to allow filtering tracebacks out of the reported error stream. That traceback filtering was removed about 4 years ago in f9429b0, butstderr
was left redirected tostdout
after that change.The text was updated successfully, but these errors were encountered: