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 a029c37 commit ca711d4
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 @@ -199,9 +199,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 ca711d4

Please sign in to comment.