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

blob.download_to_filename() broken with 0.27.0 #3841

Closed
tcroiset opened this issue Aug 18, 2017 · 3 comments
Closed

blob.download_to_filename() broken with 0.27.0 #3841

tcroiset opened this issue Aug 18, 2017 · 3 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. status: duplicate Duplicate. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@tcroiset
Copy link

I open the bug here since it's linked to the new release 0.27.0 (urrlib2 -> requests), though it crashes in dependency google-resumable-media-python

  File "/home/tristan/p/api/api/utilities/storage.py", line 21, in get_gcs_blob
    blob.download_to_filename(local_path)
  File "/home/tristan/env/api/local/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 482, in download_to_filename
    self.download_to_file(file_obj, client=client)
  File "/home/tristan/env/api/local/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 464, in download_to_file
    self._do_download(transport, file_obj, download_url, headers)
  File "/home/tristan/env/api/local/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 418, in _do_download
    download.consume(transport)
  File "/home/tristan/env/api/local/lib/python2.7/site-packages/google/resumable_media/requests/download.py", line 101, in consume
    self._write_to_stream(result)
  File "/home/tristan/env/api/local/lib/python2.7/site-packages/google/resumable_media/requests/download.py", line 62, in _write_to_stream
    with response:
AttributeError: __exit__
@dhermes
Copy link
Contributor

dhermes commented Aug 18, 2017

@tcroiset Thanks for reporting. I'm sorry to say this is the third or fourth such report (100% my fault this error is occurring).

The simple fix: make sure requests >= 2.18.0. We have releases google-cloud-storage==1.3.2 (via #3814) to ensure the minimum version.

Sorry for the inconvenience.

@dhermes dhermes closed this as completed Aug 18, 2017
@dhermes dhermes added api: storage Issues related to the Cloud Storage API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. status: duplicate Duplicate. labels Aug 18, 2017
@kparaju
Copy link

kparaju commented Mar 7, 2018

I had to uninstall requests 2.18.4 (pip uninstall requests) and install 2.18.0 (pip install requests==2.18.0) to make it work

@jasonmellone
Copy link

Still getting this as of date posting. Shouldn't https://anaconda.org/conda-forge/google-cloud-storage solve for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. status: duplicate Duplicate. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants