Skip to content
Myr

Be less defensive in get_auth_from_url.

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

authored by Cory Benfield · committed by Cory Benfield · parent b4ca6c9 · Browse files · 1 file+4 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+4 added−7 removed

  • other:+4 added−7 removed

1 file+4 added−7 removed

modified:requests/utils.py+4 added-7 removed
632 unmodified lines
633634def get_auth_from_url(url):635 """Given a url with authentication components, extract them into a tuple of636 username,password."""637 if url:638 parsed = urlparse(url)637 parsed = urlparse(url)638640 try:641 auth = (unquote(parsed.username), unquote(parsed.password))642 except (AttributeError, TypeError):643 auth = ('', '')644 else:639 try:640 auth = (unquote(parsed.username), unquote(parsed.password))641 except (AttributeError, TypeError):642 auth = ('', '')643644 return auth645
18 unmodified lines