google-api-python-client: httplib2 v0.16.0 breaks the library
Recently updated httplib2 library (v0.16.0) have a breaking change causing this Exception:
httplib2.RedirectMissingLocation: Redirected but response is missing a location: header
Steps to reproduce:
pip install --upgrade httplib2
- Now use the google drive library to upload a file (This is where I encountered the bug, it may break while using other stuffs a well)
It should either force to use 0.15.0 version of httplib2 or adapt the breaking changes introduced in the new version.
A temporary fix for those using the client library would be to add httplib2==0.15.0 in requirements,txt of the project
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 7
- Comments: 30 (5 by maintainers)
Commits related to this issue
- fix: temporarily narrow pin on httplib2 for #803 — committed to googleapis/google-api-python-client by busunkim96 4 years ago
- OpenUbot: requirement.txt update https://github.com/googleapis/google-api-python-client/issues/803 — committed to goodmeow/OpenUbot by goodmeow 4 years ago
- Handle Google's non-standard use of status 308 See https://github.com/googleapis/google-api-python-client/issues/803#issuecomment-578151576 — committed to Lykos153/python-drivelib by Lykos153 4 years ago
- Fix 100MB file uploads (#1117) See: https://github.com/googleapis/google-api-python-client/issues/803 — committed to GAM-team/GAM by taers232c 4 years ago
- [HOTFIX] Remove pinning of httplib2 Google fixed their shit, see https://github.com/googleapis/google-api-python-client/issues/803 — committed to lzzy12/python-aria-mirror-bot by lzzy12 4 years ago
- test to see if.. https://github.com/googleapis/google-api-python-client/issues/803 was fixed — committed to SayanthD/PyroGramUserBot by SayanthD 4 years ago
- Add compatibility with httplib2 0.16.0+ See more at googleapis/google-api-python-client#803. Fix applied as recommended in https://github.com/googleapis/google-api-python-client/issues/803#issuecomm... — committed to ejochman/apitools by ejochman 4 years ago
- Add compatibility with httplib2 0.16.0+ (#295) See more at googleapis/google-api-python-client#803. Fix applied as recommended in https://github.com/googleapis/google-api-python-client/issues/803#... — committed to google/apitools by ejochman 4 years ago
- fix: pin httplib2 to older version because of redirect bug Ref: https://github.com/googleapis/google-api-python-client/issues/803 — committed to agrc/backseat-driver by stdavis 4 years ago
- Expose redirect_codes on AuthorizedHttp. Similar to #9, this exposes the `redirect_codes` attribute of the underlying httplib2.Http instance on AuthorizedHttp, letting users modify the set of HTTP st... — committed to craigcitro/google-auth-library-python-httplib2 by craigcitro 4 years ago
- Expose redirect_codes on AuthorizedHttp. (#12) Similar to #9, this exposes the `redirect_codes` attribute of the underlying httplib2.Http instance on AuthorizedHttp, letting users modify the set of ... — committed to googleapis/google-auth-library-python-httplib2 by craigcitro 4 years ago
- fix(httplib): Fixees an issue related to httplib and pydrive Reference: https://github.com/googleapis/google-api-python-client/issues/803 — committed to its-hmny/ChimeraScript by its-hmny 2 years ago
Side note: what a wonderful ironic mystery this issue number is 308 backwards.
Looks like the error is back… I’ve upgraded ALL libraries to most recent:
google-api-python-client google-auth google-auth-oauthlib google-auth-httplib2
httplib2 v0.17.0 is just released with API to handle this. Sorry, I couldn’t quickly find where to apply the following patch in this repo, aside from samples (which should probably be modified too).
@pkenjora Could you please open a new issue referencing this one? Replies to closed issues are more likely to be missed by repo maintainers.
It would also be helpful if you could show the full
pip freeze
(with versions).Thanks!
Seeing this issue on httplib2 version 0.18.1 as well (Python 3.6.8)
Pip freeze:
I had to downgrade to 0.15.0 seeing the above suggestions. I see the above commit - Add compatibility with httplib2 0.16.0+ , but not sure why 0.18 (0.16.0+) is still breaking.
A set of old Airflow tasks failed last night due to this error, it looks like. Should be able to confirm tomorrow that pinning the library is a workaround.
Stack trace looks like this: