Skip to content

Commit

Permalink
Unicode fix for py3
Browse files Browse the repository at this point in the history
  • Loading branch information
ib-lundgren committed May 15, 2012
1 parent c24665b commit 6a9d59e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions requests/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ def __call__(self, r):
# >>> 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

Expand Down

0 comments on commit 6a9d59e

Please sign in to comment.