Skip to content

Commit 429ca5a

Browse files
f3flightDmitrii Sutiagin
authored andcommitted
Fix PYTHONPATH passed to envreport / "pip freeze"
1 parent 0f0c505 commit 429ca5a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Cyril Roelandt
3333
Dane Hillard
3434
David Staheli
3535
David Diaz
36+
Dmitrii Sutiagin a.k.a. f3flight
3637
Ederag
3738
Eli Collins
3839
Eugene Yunak

docs/changelog/2528.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add env cleanup to envreport - fix PYTHONPATH leak into "envreport" -- by :user:`f3flight`.

src/tox/venv.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,11 @@ def tox_runtest_post(venv):
840840
def tox_runenvreport(venv, action):
841841
# write out version dependency information
842842
args = venv.envconfig.list_dependencies_command
843-
output = venv._pcall(args, cwd=venv.envconfig.config.toxinidir, action=action, returnout=True)
843+
env = venv._get_os_environ()
844+
venv.ensure_pip_os_environ_ok(env)
845+
output = venv._pcall(
846+
args, cwd=venv.envconfig.config.toxinidir, action=action, returnout=True, env=env
847+
)
844848
# the output contains a mime-header, skip it
845849
output = output.split("\n\n")[-1]
846850
packages = output.strip().split("\n")

0 commit comments

Comments
 (0)