Skip to content

Commit 62ffd3b

Browse files
landismkwlzn
authored andcommitted
PEX: add /etc/pexrc to the list of pexrc locations to check.
This allows administrators to make it more likely that pexes are executed using a "clean" python instead of whatever users have installed on their path. /etc/pexrc is the first rc read so that it has the lowest precedence and determined users can still override whatever they like. Testing Done: Manually tested /etc/pexrc. I don't think the bang:buck is there for a unit test. (mocking out /etc takes work and there are already a bunch of other pantsrc locations that get tested anyway) https://travis-ci.org/pantsbuild/pex/builds/91981161 Bugs closed: 183 Reviewed at https://rbcommons.com/s/twitter/r/3148/
1 parent 000a8e5 commit 62ffd3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pex/variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def set(self, variable, value):
5252

5353
def _from_rc(self, rc):
5454
ret_vars = {}
55-
for filename in [rc, os.path.join(os.path.dirname(sys.argv[0]), '.pexrc')]:
55+
for filename in ['/etc/pexrc', rc, os.path.join(os.path.dirname(sys.argv[0]), '.pexrc')]:
5656
try:
5757
with open(os.path.expanduser(filename)) as fh:
5858
rc_items = map(self._get_kv, fh)

0 commit comments

Comments
 (0)