Unquote the URL before extracting the auth.
authorCory Benfield <lukasaoz@gmail.com>
Sun, 1 Dec 2013 10:28:49 +0000 (10:28 +0000)
committerCory Benfield <lukasaoz@gmail.com>
Sun, 1 Dec 2013 10:29:14 +0000 (10:29 +0000)
requests/utils.py

index 4283560ef2a1d16b3647472196e83e9bb94ada43..57292c356ac460e72cadeae1148336c07a365c1f 100644 (file)
@@ -21,8 +21,8 @@ import sys
 from . import __version__
 from . import certs
 from .compat import parse_http_list as _parse_list_header
-from .compat import (quote, urlparse, bytes, str, OrderedDict, urlunparse,
-                     is_py2, is_py3, builtin_str, getproxies, proxy_bypass)
+from .compat import (quote, urlparse, bytes, str, OrderedDict, unquote, is_py2,
+                     builtin_str, getproxies, proxy_bypass)
 from .cookies import RequestsCookieJar, cookiejar_from_dict
 from .structures import CaseInsensitiveDict
 from .exceptions import MissingSchema, InvalidURL
@@ -558,6 +558,7 @@ def get_auth_from_url(url):
     """Given a url with authentication components, extract them into a tuple of
     username,password."""
     if url:
+        url = unquote(url)
         parsed = urlparse(url)
         return (parsed.username, parsed.password)
     else: