René's URL Explorer Experiment


Title: blob.download_to_filename fails with google-cloud-storage==1.3.0 · Issue #3736 · googleapis/google-cloud-python · GitHub

Open Graph Title: blob.download_to_filename fails with google-cloud-storage==1.3.0 · Issue #3736 · googleapis/google-cloud-python

X Title: blob.download_to_filename fails with google-cloud-storage==1.3.0 · Issue #3736 · googleapis/google-cloud-python

Description: Due to the notable implementation changes in google-cloud-storage 1.3.0, the blob.download_to_filename fails whatever google-cloud from 0.24.0 to 0.27.0 (latest) Our prod server which using google-cloud==0.24.0 has been broken since last...

Open Graph Description: Due to the notable implementation changes in google-cloud-storage 1.3.0, the blob.download_to_filename fails whatever google-cloud from 0.24.0 to 0.27.0 (latest) Our prod server which using google-...

X Description: Due to the notable implementation changes in google-cloud-storage 1.3.0, the blob.download_to_filename fails whatever google-cloud from 0.24.0 to 0.27.0 (latest) Our prod server which using google-...

Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/3736

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"blob.download_to_filename fails with google-cloud-storage==1.3.0","articleBody":"Due to the notable implementation changes in **google-cloud-storage 1.3.0**, the **_blob.download_to_filename_** fails whatever **google-cloud** from **0.24.0** to **0.27.0** (latest)\r\n\r\nOur prod server which using **google-cloud==0.24.0** has been broken since last Saturday. I analyzed a bit the error. The problem is come from the upgraded package **google-cloud-storage==1.3.0**. We are using the **google-cloud-storage==1.2.0**.\r\n\r\nI did several tests which figured out the following problems:\r\n\r\n**Problem 1:** _blob.download_to_filename failed when using google-cloud==0.27.0_ (included **google-cloud-storage==1.3.0** as default, defined in **setup.py**). Here is a part of stacktrace:\r\n```python\r\nblob.download_to_filename(blob_local_path)\r\n  File \"/root/.local/lib/python2.7/site-packages/google/cloud/storage/blob.py\", line 482, in download_to_filename\r\n    self.download_to_file(file_obj, client=client)\r\n  File \"/root/.local/lib/python2.7/site-packages/google/cloud/storage/blob.py\", line 464, in download_to_file\r\n    self._do_download(transport, file_obj, download_url, headers)\r\n  File \"/root/.local/lib/python2.7/site-packages/google/cloud/storage/blob.py\", line 418, in _do_download\r\n    download.consume(transport)\r\n  File \"/root/.local/lib/python2.7/site-packages/google/resumable_media/requests/download.py\", line 101, in consume\r\n    self._write_to_stream(result)\r\n  File \"/root/.local/lib/python2.7/site-packages/google/resumable_media/requests/download.py\", line 62, in _write_to_stream\r\n    with response:\r\nAttributeError: __exit__\r\n```\r\n\r\n**Problem 2:** _blob.download_to_filename failed when using google-cloud==0.24.0_ (included **google-cloud-storage==1.3.0** as default, defined in **setup.py**). Here is a part of stacktrace:\r\n```python\r\nFile \"dev_env/python_venv/local/lib/python2.7/site-packages/google/cloud/storage/blob.py\", line 482, in download_to_filename\r\n    self.download_to_file(file_obj, client=client)\r\n  File \"dev_env/python_venv/local/lib/python2.7/site-packages/google/cloud/storage/blob.py\", line 464, in download_to_file\r\n    self._do_download(transport, file_obj, download_url, headers)\r\n  File \"dev_env/python_venv/local/lib/python2.7/site-packages/google/cloud/storage/blob.py\", line 418, in _do_download\r\n    download.consume(transport)\r\n  File \"dev_env/python_venv/local/lib/python2.7/site-packages/google/resumable_media/requests/download.py\", line 96, in consume\r\n    transport, method, url, **request_kwargs)\r\n  File \"dev_env/python_venv/local/lib/python2.7/site-packages/google/resumable_media/requests/_helpers.py\", line 101, in http_request\r\n    func, RequestsMixin._get_status_code, retry_strategy)\r\n  File \"dev_env/python_venv/local/lib/python2.7/site-packages/google/resumable_media/_helpers.py\", line 146, in wait_and_retry\r\n    response = func()\r\n  File \"dev_env/python_venv/local/lib/python2.7/site-packages/google_auth_httplib2.py\", line 198, in request\r\n    uri, method, body=body, headers=request_headers, **kwargs)\r\nTypeError: request() got an unexpected keyword argument 'data'\r\n```\r\n\r\nSo, why it happened? I realized that in the _REQUIREMENTS_ of the package **google-cloud** which is defined in the file **setup.py**. An example for **google-cloud==0.27.0** https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/setup.py#L67\r\n\r\n- **google-cloud==0.24.0** requires google-cloud-storage \u003e= 1.0.0 and **\u003c 2.0dev**\r\n- **google-cloud==0.25.0** requires google-cloud-storage \u003e= 1.1.0 and **\u003c 2.0dev**  =\u003e https://github.com/GoogleCloudPlatform/google-cloud-python/commit/bd9fdfba07fac63a91847628613928a569250c0f#diff-2eeaed663bd0d25b7e608891384b7298R66\r\n- **google-cloud==0.25.1** requires google-cloud-storage \u003e= 1.1.0 and **\u003c 1.2dev**  =\u003e https://github.com/GoogleCloudPlatform/google-cloud-python/commit/ad4b02c88088666e298aa53cd61687b461c09191#diff-2eeaed663bd0d25b7e608891384b7298R66\r\n- **google-cloud==0.26.0** requires google-cloud-storage \u003e= 1.2.0 and **\u003c 2.0dev** =\u003e https://github.com/GoogleCloudPlatform/google-cloud-python/commit/214aba604fbcaa9e4936fa1798efde050389992a#diff-2eeaed663bd0d25b7e608891384b7298R67\r\n- **google-cloud==0.26.1** requires google-cloud-storage \u003e= 1.2.0 and **\u003c 1.3dev** =\u003e https://github.com/GoogleCloudPlatform/google-cloud-python/commit/ea5245ad27e777c654448a259a9fa5f6bf5d758e#diff-2eeaed663bd0d25b7e608891384b7298R67\r\n- **google-cloud==0.27.0** requires google-cloud-storage \u003e= 1.3.0 and **\u003c 1.4dev** =\u003e https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/setup.py#L67\r\n\r\nWe can see that if we only define **google-cloud==[0.24.0 to 0.27.0]**, \"pip install\" always try to install **google-cloud-storage 1.3.0** which requires the dependencies **google-cloud-core ~= 0.26**. That's why the bug happens.\r\n\r\n**Solution:**\r\n- Downgrade to **google-cloud \u003c 0.27.0** and force the requirements **google-cloud-storage \u003c 1.3.0**\r\n- The problem seems still there with **google-cloud==0.27.0** and **google-cloud-storage==1.3.0** (to check but at least it has been broken for my case, see **Problem 2** above)\r\n\r\n**Suggestion:** better manage the deps for **google-cloud** in **setup.py**.\r\n\r\nThanks.\r\n\r\n","author":{"url":"https://github.com/sonlac","@type":"Person","name":"sonlac"},"datePublished":"2017-08-07T15:21:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/3736/google-cloud-python/issues/3736"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1be6ba1a-7a60-90d3-9354-4742d28dd292
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9CDA:1ED3:2C34FB:390BFF:6A4D857A
html-safe-nonce934b6ce21f78434b8c290d3cee65986eddcd6a8731e259055cb8ebd4e68df9da
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0RBOjFFRDM6MkMzNEZCOjM5MEJGRjo2QTREODU3QSIsInZpc2l0b3JfaWQiOiI0ODYyNzUzMDE5MzA3ODUzMTc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac036dcbfb62b0d2c79ac40c0a1a90171c3730ec5854afb7fb7578cf68932f83f7
hovercard-subject-tagissue:248445151
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/3736/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c1dfdc5df3270a1888af17d50e7a3261776da99becf79538b06ed27ffc4994e1/googleapis/google-cloud-python/issues/3736
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c1dfdc5df3270a1888af17d50e7a3261776da99becf79538b06ed27ffc4994e1/googleapis/google-cloud-python/issues/3736
og:image:altDue to the notable implementation changes in google-cloud-storage 1.3.0, the blob.download_to_filename fails whatever google-cloud from 0.24.0 to 0.27.0 (latest) Our prod server which using google-...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesonlac
hostnamegithub.com
expected-hostnamegithub.com
Nonec6bf61c909482ec3072ef5d7a5a28f2a9d214788c9a44793eca1960048cb05ae
turbo-cache-controlno-preview
go-importgithub.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id16316451
octolytics-dimension-repository_nwogoogleapis/google-cloud-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id16316451
octolytics-dimension-repository_network_root_nwogoogleapis/google-cloud-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release6702a58b419a792226bd21ef0fb1bcb318bbcaa3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/google-cloud-python/issues/3736#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F3736
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F3736
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fgoogle-cloud-python
Reloadhttps://github.com/googleapis/google-cloud-python/issues/3736
Reloadhttps://github.com/googleapis/google-cloud-python/issues/3736
Reloadhttps://github.com/googleapis/google-cloud-python/issues/3736
Please reload this pagehttps://github.com/googleapis/google-cloud-python/issues/3736
googleapis https://github.com/googleapis
google-cloud-pythonhttps://github.com/googleapis/google-cloud-python
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Fork 1.7k https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Star 5.3k https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Code https://github.com/googleapis/google-cloud-python
Issues 439 https://github.com/googleapis/google-cloud-python/issues
Pull requests 129 https://github.com/googleapis/google-cloud-python/pulls
Discussions https://github.com/googleapis/google-cloud-python/discussions
Actions https://github.com/googleapis/google-cloud-python/actions
Projects https://github.com/googleapis/google-cloud-python/projects
Security and quality 0 https://github.com/googleapis/google-cloud-python/security
Insights https://github.com/googleapis/google-cloud-python/pulse
Code https://github.com/googleapis/google-cloud-python
Issues https://github.com/googleapis/google-cloud-python/issues
Pull requests https://github.com/googleapis/google-cloud-python/pulls
Discussions https://github.com/googleapis/google-cloud-python/discussions
Actions https://github.com/googleapis/google-cloud-python/actions
Projects https://github.com/googleapis/google-cloud-python/projects
Security and quality https://github.com/googleapis/google-cloud-python/security
Insights https://github.com/googleapis/google-cloud-python/pulse
blob.download_to_filename fails with google-cloud-storage==1.3.0https://github.com/googleapis/google-cloud-python/issues/3736#top
https://github.com/dhermes
api: storageIssues related to the Cloud Storage API.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22api%3A%20storage%22
status: investigatingThe issue is under investigation, which is determined to be non-trivial.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22status%3A%20investigating%22
https://github.com/sonlac
sonlachttps://github.com/sonlac
on Aug 7, 2017https://github.com/googleapis/google-cloud-python/issues/3736#issue-248445151
https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/setup.py#L67https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/setup.py#L67
bd9fdfb#diff-2eeaed663bd0d25b7e608891384b7298R66https://github.com/googleapis/google-cloud-python/commit/bd9fdfba07fac63a91847628613928a569250c0f#diff-2eeaed663bd0d25b7e608891384b7298R66
ad4b02c#diff-2eeaed663bd0d25b7e608891384b7298R66https://github.com/googleapis/google-cloud-python/commit/ad4b02c88088666e298aa53cd61687b461c09191#diff-2eeaed663bd0d25b7e608891384b7298R66
214aba6#diff-2eeaed663bd0d25b7e608891384b7298R67https://github.com/googleapis/google-cloud-python/commit/214aba604fbcaa9e4936fa1798efde050389992a#diff-2eeaed663bd0d25b7e608891384b7298R67
ea5245a#diff-2eeaed663bd0d25b7e608891384b7298R67https://github.com/googleapis/google-cloud-python/commit/ea5245ad27e777c654448a259a9fa5f6bf5d758e#diff-2eeaed663bd0d25b7e608891384b7298R67
https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/setup.py#L67https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/setup.py#L67
dhermeshttps://github.com/dhermes
api: storageIssues related to the Cloud Storage API.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22api%3A%20storage%22
status: investigatingThe issue is under investigation, which is determined to be non-trivial.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22status%3A%20investigating%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.