From 6a9d59ea97f9681b57c1fe0db263b7e2af3e60c9 Mon Sep 17 00:00:00 2001 From: Ib Lundgren Date: Tue, 15 May 2012 17:37:15 +0200 Subject: [PATCH] Unicode fix for py3 --- requests/auth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.34.1