-
Notifications
You must be signed in to change notification settings - Fork 431
Switched headers to be normalized as strings, not bytes, in keeping with httplib2. #136
Switched headers to be normalized as strings, not bytes, in keeping with httplib2. #136
Conversation
Changes Unknown when pulling f41eb74 on foozlevazquez:fix-header-strings-for-httplib2 into * on google:master*. |
isn't this the same issue as #104 ? |
@craigcitro #104 is the same root problem, but the conclusion that the bug lies in httplib2 is mistaken: httplib2 clearly expects strings and not bytes in headers, so this is not a bug with httplib2. |
try: | ||
import urlparse | ||
except ImportError: | ||
from urllib.parse import urlparse |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I would argue #104 is "on the right track" and that Uses of |
Should I expect this to be solved soon or should I find a workaround? |
@cganterh This is only needed for Python 3, if that helps. |
@dhermes my whole project is based on Python 3 and is strongly dependent on Python 3 libraries. Is it a good idea to fork oauth2client or httplib2 and apply the pull requests myself so I can go on while this issue is being fixed? |
@cganterh: Why fork httplib2? What change would you want to make to httplib2 that hasn't been accepted by the httplib2 maintainers? |
Correct me if im wrong, but I think that #136, #104 and jcgregorio/httplib2#291 are trying to solve the same issue. However I haven't read the pull requests in depth. |
Okay, I suspected that they were all the same thing. It looks like getting a fix into httplib2 is blocked on writing test coverage for the fix, which is something that anyone can do. |
Yes, I know. But I think I'm not the most appropriate person to do this, since I have little experience on writing tests and it is my first time using the library. So I thought it was a bad idea to do it myself and maybe a better one was to just use some of the pull requests while the problem was actually being fixed. Now I think it doesn't make sense to fork the whole library rather than using the fork that the author of the pull request already made. |
@anthmgoogle I don't think @jcgregorio is actively maintaining |
All that's stopping |
So I finally decided to write the unit test for jcgregorio/httplib2#291. |
What action remains to be taken in this pull request now that the fix in httplib2 has been made? |
@nathanielmanistaatgoogle I am going through this to see if there is anything we missed in #250 |
It appears that earlier contributors made the attempt to keep everything as bytes, mostly deducing from the test code. This doesn't work with the Python3 version of
httplib2
, and it is exactly this issue (bytes
being passed to the Python3 version ofhttplib2
instead ofstr
) that causes corrupt headers.httplib2
is very clear about what it expects.Given the dependency on
httplib2
, inoauth2client
, it makes sense to me thatoauth2client
should follow its lead and use whatever version ofstr
for headers makes sense in the version of Python it is using.