diff options
author | Kevin Burke <kev@inburke.com> | 2014-09-10 12:22:24 -0700 |
---|---|---|
committer | Kevin Burke <kev@inburke.com> | 2014-09-10 12:22:24 -0700 |
commit | 6a70afeb7e6d2b4f318976ad059f27ae83c32781 (patch) | |
tree | 2d09b18b59763e2b3ad5f71ba5eb7de902fc05cd /pip/_vendor/requests/auth.py | |
parent | a4dcc272225b026c2ec63e7ee78c94aa5d50562f (diff) | |
download | pip-6a70afeb7e6d2b4f318976ad059f27ae83c32781.tar.gz |
update requests to 2.4.1 and add certifi dependency
Diffstat (limited to 'pip/_vendor/requests/auth.py')
-rw-r--r-- | pip/_vendor/requests/auth.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pip/_vendor/requests/auth.py b/pip/_vendor/requests/auth.py index 9f831b7ad..9b6426dc0 100644 --- a/pip/_vendor/requests/auth.py +++ b/pip/_vendor/requests/auth.py @@ -16,7 +16,7 @@ from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar -from .utils import parse_dict_header +from .utils import parse_dict_header, to_native_string CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded' CONTENT_TYPE_MULTI_PART = 'multipart/form-data' @@ -25,7 +25,11 @@ CONTENT_TYPE_MULTI_PART = 'multipart/form-data' def _basic_auth_str(username, password): """Returns a Basic Auth string.""" - return 'Basic ' + b64encode(('%s:%s' % (username, password)).encode('latin1')).strip().decode('latin1') + authstr = 'Basic ' + to_native_string( + b64encode(('%s:%s' % (username, password)).encode('latin1')).strip() + ) + + return authstr class AuthBase(object): |