jcgregorio/httplib2 — pull request #291 by i026e (2014-12-17 08:28:01+00:00)
Title: Update __init__.py

There was a problem with headers when a binary string is passed (like b'Authorization')
"""
File "/usr/local/lib/python3.4/dist-packages/oauth2client/util.py", line 132, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/oauth2client/client.py", line 545, in new_request
redirections, connection_type)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 1146, in request
headers = self._normalize_headers(headers)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 1114, in _normalize_headers
return _normalize_headers(headers)
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 196, in _normalize_headers
print(dict([ (_convert_byte_str(key).lower(), NORMALIZE_SPACE.sub(_convert_byte_str(value), ' ').strip()) for (key, value) in headers.items()]))
File "/usr/local/lib/python3.4/dist-packages/httplib2/__init__.py", line 196, in
print(dict([ (_convert_byte_str(key).lower(), NORMALIZE_SPACE.sub(_convert_byte_str(value), ' ').strip()) for (key, value) in headers.items()]))
TypeError: sequence item 0: expected str instance, bytes found

Process finished with exit code 1
"""
I've added a function to decode such strings to normal ones.
It is not an elegant solution, but it works for me