We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7341690 commit 96ba401Copy full SHA for 96ba401
src/requests/utils.py
@@ -236,13 +236,7 @@ def get_netrc_auth(url, raise_errors=False):
236
return
237
238
ri = urlparse(url)
239
-
240
- # Strip port numbers from netloc. This weird `if...encode`` dance is
241
- # 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]
+ host = ri.hostname
246
247
try:
248
_netrc = netrc(netrc_path).authenticators(host)
0 commit comments