Skip to content

Fix empty netrc entry usage#7205

Merged
nateprewitt merged 2 commits intomainfrom
empty_default_netrc
Feb 13, 2026
Merged

Fix empty netrc entry usage#7205
nateprewitt merged 2 commits intomainfrom
empty_default_netrc

Conversation

@nateprewitt
Copy link
Member

Prior to Python 3.11, a netrc entry without a username, account, or password entry was treated as malformed and raised a NetrcParseError disabling usage. For 3.11+, it now returns an empty tuple ('', '' ,'') instead. That results in Requests sending an empty entry (:) for the value to encode in an Authorization header.

This PR brings Requests back to its intended behavior of ignoring these profiles. Anyone who may have some use case for this, we did not to intend to support this behavior. If you need it going forward, you can pass auth=('', '') with your request.

@nateprewitt nateprewitt merged commit 4791422 into main Feb 13, 2026
49 checks passed
@nateprewitt nateprewitt deleted the empty_default_netrc branch February 13, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants