Title: storage: cannot set object properties · Issue #536 · googleapis/google-cloud-python · GitHub
Open Graph Title: storage: cannot set object properties · Issue #536 · googleapis/google-cloud-python
X Title: storage: cannot set object properties · Issue #536 · googleapis/google-cloud-python
Description: Or at least I haven't figured out how. This is how the documentation suggests it may work. >>> from gcloud import storage >>> bucket = storage.get_bucket('bucket', 'id') >>> key = storage.key.Key(bucket=bucket, name='dir/file.webp', ... ...
Open Graph Description: Or at least I haven't figured out how. This is how the documentation suggests it may work. >>> from gcloud import storage >>> bucket = storage.get_bucket('bucket', 'id') >>> key = storage.key.Key(b...
X Description: Or at least I haven't figured out how. This is how the documentation suggests it may work. >>> from gcloud import storage >>> bucket = storage.get_bucket('bucket', ...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/536
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"storage: cannot set object properties","articleBody":"Or at least I haven't figured out how. This is how the documentation suggests it may work.\n\n``` Python\n\u003e\u003e\u003e from gcloud import storage\n\u003e\u003e\u003e bucket = storage.get_bucket('bucket', 'id')\n\u003e\u003e\u003e key = storage.key.Key(bucket=bucket, name='dir/file.webp', \n... properties={'contentType': 'image/webp'})\n\u003e\u003e\u003e key.upload_from_filename('dir/file.webp')\n```\n\nSuccess?\n\n``` Python\n\u003e\u003e\u003e key.properties['contentType']\n'image/webp'\n\u003e\u003e\u003e key.content_type\n'image/webp'\n```\n\nIt's a lie unfortunately. (Also verified with `gsutil`).\n\n``` Python\n\u003e\u003e\u003e webp = bucket.get_key('dir/file.webp')\n\u003e\u003e\u003e webp.properties['contentType']\nu'application/unknown'\n\u003e\u003e\u003e webp.content_type\nu'application/unknown'\n```\n","author":{"url":"https://github.com/pdknsk","@type":"Person","name":"pdknsk"},"datePublished":"2015-01-12T22:07:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/536/google-cloud-python/issues/536"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1393e5f5-00e4-23ca-1553-341b1c3c8ef7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB0C:1FFDFF:1672CD2:1E97E80:6A4F0A5F |
| html-safe-nonce | 8dfba2b139465318dcac8b2ce94a381591edbb9b3732436ce6a257f7dee1d4d4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjBDOjFGRkRGRjoxNjcyQ0QyOjFFOTdFODA6NkE0RjBBNUYiLCJ2aXNpdG9yX2lkIjoiNzk1ODEzNzc2MjAxMTM1MTY0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 326d7d9d32c5829f0ec7a09cb5746c667e92e336194cdee2e1974c76f9044490 |
| hovercard-subject-tag | issue:54113994 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/536/issue_layout |
| twitter:image | https://opengraph.githubassets.com/24079704016dfa1625723dd7e2dfbf7fd3a5e08a2d8d62dcc244623b39d46684/googleapis/google-cloud-python/issues/536 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/24079704016dfa1625723dd7e2dfbf7fd3a5e08a2d8d62dcc244623b39d46684/googleapis/google-cloud-python/issues/536 |
| og:image:alt | Or at least I haven't figured out how. This is how the documentation suggests it may work. >>> from gcloud import storage >>> bucket = storage.get_bucket('bucket', 'id') >>> key = storage.key.Key(b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pdknsk |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width