Skip to content

Commit 1fa49ef

Browse files
committed
Convert Nonetype arguments to string before calling HTTPBasicAuth
This is for forward compatibility with requests 3.0.0 (see Line 28 in 2e51624)
1 parent 2cd6f7a commit 1fa49ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pip/_internal/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def __call__(self, req):
332332

333333
if username is not None or password is not None:
334334
# Send the basic auth with this request
335-
req = HTTPBasicAuth(username, password)(req)
335+
req = HTTPBasicAuth(username or "", password or "")(req) # Avoid passing Nonetype
336336

337337
# Attach a hook to handle 401 responses
338338
req.register_hook("response", self.handle_401)

0 commit comments

Comments
 (0)