Unicode fix for py3

This commit is contained in:
Ib Lundgren
2012-05-15 17:37:15 +02:00
parent c24665b593
commit 6a9d59ea97
+4 -4
View File
@@ -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