From: Kenneth Reitz Date: Sun, 23 Oct 2011 15:14:59 +0000 (-0400) Subject: fix base64 encoding for httpbasic X-Git-Tag: v0.7.1~1^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dae52220b274890af08ac040bd90747146c3d90;p=services%2Fpython-requests.git fix base64 encoding for httpbasic --- diff --git a/requests/auth.py b/requests/auth.py index 0a0402b..3a978b1 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -7,7 +7,7 @@ requests.auth This module contains the authentication handlers for Requests. """ -from base64 import base64 +from base64 import b64encode def http_basic(r, username, password): """Attaches HTTP Basic Authentication to the given Request object. @@ -17,7 +17,7 @@ def http_basic(r, username, password): username = str(username) password = str(password) - auth_s = base64('%s:%s' % (username, password)) + auth_s = b64encode('%s:%s' % (username, password)) r.headers['Authorization'] = ('Basic %s' % auth_s) return r