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

Fix a bug with enviroment variable injection to the git repo url #2710

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2635.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a enviroment injection issue when dealing with git repo url dependencies. The problem issued when pipenv trying to execute command similar to "git clone -q git+https://${USER}:${PASSWORD}/github.com" using python subprocess.Popen, the enviroment variable inside this command is not propely resolved.Which will cause a permission deny error or a repo not found error.
2 changes: 2 additions & 0 deletions pipenv/patched/notpip/_internal/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ def call_subprocess(cmd, show_stdout=True, cwd=None,
command_desc = ' '.join(cmd_parts)
logger.debug("Running command %s", command_desc)
env = os.environ.copy()
for idx in range(len(cmd)):
cmd[idx] = os.path.expandvars(cmd[idx])
if extra_environ:
env.update(extra_environ)
for name in unset_environ:
Expand Down