Skip to content

Update __init__.py#291

Merged
jcgregorio merged 1 commit intojcgregorio:masterfrom
i026e:master
Mar 3, 2015
Merged

Update __init__.py#291
jcgregorio merged 1 commit intojcgregorio:masterfrom
i026e:master

Conversation

@i026e
Copy link
Copy Markdown
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
Copy Markdown
Owner

Needs unit tests.

@cganterh
Copy link
Copy Markdown
Contributor

cganterh commented Mar 3, 2015

Hi I added the unit test in #296.

@rstuart85
Copy link
Copy Markdown

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

@dhermes
Copy link
Copy Markdown

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
Copy Markdown

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