Skip to content
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

Preserve environment variables when running Popen. #69

Closed
wants to merge 1 commit into from

Conversation

rkuska
Copy link
Contributor

@rkuska rkuska commented Mar 2, 2016

Popen does not inherit environment variables of current process
when run with env argument defined (and not None). We therefore
pass copy of the current environment with PYTHONPATH modified to
our needs.

See:

>>> subprocess.Popen('/usr/bin/echo $LD_LIBRARY_PATH', shell=True, env={'PYTHONPATH': '.'}, stdout=subprocess.PIPE).stdout.read()
b'\n'
>>> subprocess.Popen('/usr/bin/echo $LD_LIBRARY_PATH', shell=True, stdout=subprocess.PIPE).stdout.read()
b'/opt/rh/rh-python34/root/usr/lib64\n'

This may lead to failure when trying to install python bindings of qpid-proton.
https://bugzilla.redhat.com/show_bug.cgi?id=1312590

`Popen` does not inherit environment variables of current process
when run with `env` argument defined (and not None). We therefore
pass copy of the current environment with PYTHONPATH modified to
our needs.
@asfgit asfgit closed this in b9cd200 Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant