Skip to content
Myr

Only use hostname to do netrc lookup instead of netloc

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nate Prewitt · committed by Ian Stapleton Cordasco · parent 7341690 · Browse files · 1 file+1 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−7 removed

  • other:+1 added−7 removed

1 file+1 added−7 removed

modified:src/requests/utils.py+1 added-7 removed
234 unmodified lines
235 if netrc_path is None:236 return237238 ri = urlparse(url)239 host = ri.hostname240240 # Strip port numbers from netloc. This weird `if...encode`` dance is241 # used for Python 3.2, which doesn't support unicode literals.242 splitstr = b":"243 if isinstance(url, str):244 splitstr = splitstr.decode("ascii")245 host = ri.netloc.split(splitstr)[0]246241 try:242 _netrc = netrc(netrc_path).authenticators(host)243 if _netrc:244 # Return with login / password
849 unmodified lines