projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d977ee8
)
Avoid unnecessary encode/decode cycles.
author
Cory Benfield
<lukasaoz@gmail.com>
Sun, 8 Jun 2014 09:28:26 +0000
(10:28 +0100)
committer
Cory Benfield
<lukasaoz@gmail.com>
Sun, 8 Jun 2014 09:28:35 +0000
(10:28 +0100)
requests/auth.py
patch
|
blob
|
history
diff --git
a/requests/auth.py
b/requests/auth.py
index 84cd9c8c2ec4f17185409c0bb7a956b5bbf2ce8e..9b6426dc06603ce4f661acfe6c92da486122fd45 100644
(file)
--- a/
requests/auth.py
+++ b/
requests/auth.py
@@
-25,11
+25,11
@@
CONTENT_TYPE_MULTI_PART = 'multipart/form-data'
def _basic_auth_str(username, password):
"""Returns a Basic Auth string."""
- authstr = 'Basic ' +
b64encode
(
-
('%s:%s' % (username, password)).encode('latin1'
)
- )
.strip()
+ authstr = 'Basic ' +
to_native_string
(
+
b64encode(('%s:%s' % (username, password)).encode('latin1')).strip(
)
+ )
- return
to_native_string(authstr, encoding='latin1')
+ return
authstr
class AuthBase(object):