From: Ib Lundgren Date: Tue, 15 May 2012 15:37:15 +0000 (+0200) Subject: Unicode fix for py3 X-Git-Tag: v0.13.0~15^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a9d59ea97f9681b57c1fe0db263b7e2af3e60c9;p=services%2Fpython-requests.git Unicode fix for py3 --- diff --git a/requests/auth.py b/requests/auth.py index c9a1a02..e636b72 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -98,11 +98,11 @@ class OAuth1(AuthBase): # >>> d['a'] = 'foo' # >>> d # { u'a' : 'foo' } - if u'Authorization' in r.headers: - auth_header = r.headers[u'Authorization'].encode('utf-8') - del r.headers[u'Authorization'] + u_header = unicode('Authorization') + if u_header in r.headers: + auth_header = r.headers[u_header].encode('utf-8') + del r.headers[u_header] r.headers['Authorization'] = auth_header - print r.headers return r