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

./pants repl strips all environment variables #4795

Closed
kwlzn opened this issue Aug 8, 2017 · 2 comments
Closed

./pants repl strips all environment variables #4795

kwlzn opened this issue Aug 8, 2017 · 2 comments
Assignees
Labels

Comments

@kwlzn
Copy link
Member

kwlzn commented Aug 8, 2017

[omerta pants (master)]$ git rev-parse HEAD
17b905c5c79c7964e4e6c5ac26ec50567c4e7c3f
[omerta pants (master)]$ ./pants -q repl 3rdparty/python:psutil

Python 2.7.10 (default, Dec 16 2015, 14:09:45) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import os; os.environ
{'__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'VERSIONER_PYTHON_VERSION': '2.7'}
>>> 

vs expected:

[omerta pants (master)]$ python -c 'import os; print(len(os.environ))'
54
@baroquebobcat
Copy link
Contributor

It looks like this could be as simple as passing the env kwarg to the repl launcher.

@baroquebobcat baroquebobcat self-assigned this Aug 11, 2017
baroquebobcat added a commit to baroquebobcat/pants that referenced this issue Aug 11, 2017
Problem

The python repl zeros out the environment variables. See pantsbuild#4795

Solution

Pass a copy of the current environment to the repl pex when it is run.

Result

The environment is accessible from the repl
baroquebobcat added a commit that referenced this issue Aug 11, 2017
### Problem

The python repl zeros out the environment variables. See #4795

### Solution

Pass a copy of the current environment to the repl pex when it is run.

### Result

The environment is accessible from the repl
@kwlzn
Copy link
Member Author

kwlzn commented Aug 25, 2017

fixed in #4808

@kwlzn kwlzn closed this as completed Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants