Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update __init__.py #291

Merged
merged 1 commit into from
Mar 3, 2015
Merged

Update __init__.py #291

merged 1 commit into from
Mar 3, 2015

Conversation

i026e
Copy link
Contributor

@i026e i026e commented Dec 17, 2014

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
return dict([ key.lower(), NORMALIZE_SPACE.sub(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

There is a problem with headers when a binary string is passed (like b'Authorization')
I've added a function to decode such strings.
It is not an elegant solution, but it works for me
@jcgregorio
Copy link
Owner

Needs unit tests.

@cganterh
Copy link
Contributor

cganterh commented Mar 3, 2015

Hi I added the unit test in #296.

@rstuart85
Copy link

@jcgregorio Just wondering if there is a timeline for this to be officially released?

@dhermes
Copy link

dhermes commented Mar 24, 2015

👍 @jcgregorio Would love to see a release. Happy to help make the process super easy through GitHub and Travis if you like.

@Coffei
Copy link

Coffei commented Apr 3, 2015

@jcgregorio I would also love to see a release. This bug is actually preventing me from pushing new features to my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants