Skip to content

Google cloud storage needs requests >= 2.18.0 but the setup.py only requires >= 2.4.0 #3747

@newt0311

Description

@newt0311

According to the requests changelog the Response class was turned into a context manager only in version 2.18.0. However in google/resumable_media/requests/download.py line 62 (inside _write_to_stream) the code tries to use "response" as a context manager. Some digging reveals that this response makes its way from Client._http which is defined in google/cloud/client.py and gets the Response object from google/auth/transport/requests.py:AuthorizedSession.

So... it definitely feels like something in here needs to require requests >= 2.18.0 (maybe all of them?).

Thoughts?

Detailed info:

  1. OS type and version: N/A
  2. Python version and virtual environment information: 2.7 but I don't think it matters.
  3. google-cloud-python version: google-cloud-storage v 1.3.1
  4. Stacktrace if available: below.
  5. Steps to reproduce: Install a version of the requests library less than 2.18.0. Get some blob that exists. Try blob.download_as_string(). I personally re-pro'd this with version 2.10.0 to check. Note that the setup.py only requires 2.0.0 for storage and 2.4.0 for client, etc...

-- PG.

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions