Skip to content

Commit

Permalink
Fix repository credentials take priority over .netrc
Browse files Browse the repository at this point in the history
  • Loading branch information
hugofvs committed Oct 7, 2024
1 parent 946aae7 commit 4b12caf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/poetry/utils/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ def request(
credential = self.get_credentials_for_url(url)

if credential.username is not None or credential.password is not None:
request = requests.auth.HTTPBasicAuth(
request.auth = requests.auth.HTTPBasicAuth(
credential.username or "", credential.password or ""
)(request)
)
request.auth(request)

session = self.get_session(url=url)
prepared_request = session.prepare_request(request)
Expand Down

0 comments on commit 4b12caf

Please sign in to comment.