Skip to content

Commit 996d4fa

Browse files
committed
Take copy of os.environ rather than editing
1 parent 888c3b6 commit 996d4fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pip/_internal/network/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _get_password(cls, service_name: str, username: str) -> Optional[str]:
133133
return None
134134

135135
cmd = [cls.keyring, "get", service_name, username]
136-
env = os.environ
136+
env = os.environ.copy()
137137
env["PYTHONIOENCODING"] = "utf-8"
138138
res = subprocess.run(
139139
cmd,
@@ -153,7 +153,7 @@ def _set_password(cls, service_name: str, username: str, password: str) -> None:
153153

154154
cmd = [cls.keyring, "set", service_name, username]
155155
input_ = password.encode("utf-8") + b"\n"
156-
env = os.environ
156+
env = os.environ.copy()
157157
env["PYTHONIOENCODING"] = "utf-8"
158158
res = subprocess.run(cmd, input=input_, env=env)
159159
res.check_returncode()

0 commit comments

Comments
 (0)