Skip to content
Myr

Avoid unnecessary encode/decode cycles.

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 d977ee8 · Browse files · 1 file+4 added−4 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−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:requests/auth.py+4 added-4 removed
23 unmodified lines
2425def _basic_auth_str(username, password):26 """Returns a Basic Auth string."""2728 authstr = 'Basic ' + b64encode(29 ('%s:%s' % (username, password)).encode('latin1')30 ).strip()28 authstr = 'Basic ' + to_native_string(29 b64encode(('%s:%s' % (username, password)).encode('latin1')).strip()30 )3132 return to_native_string(authstr, encoding='latin1')32 return authstr333435class AuthBase(object):36 """Base class that all auth implementations derive from"""
161 unmodified lines