Skip to content

Commit

Permalink
Bypass unnecessary GCS storage.buckets.get permission (#516)
Browse files Browse the repository at this point in the history
* Avoid unnecessary GCS storage.buckets.get permission

* Update CHANGELOG.md

Co-authored-by: gelioz <>
Co-authored-by: Michael Penkov <m@penkov.dev>
  • Loading branch information
gelioz and mpenkov committed Jul 3, 2020
1 parent 168fa9a commit d08f1ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@ target/
# PyCharm
.idea/

# VSCode
.vscode/

# env files
.env
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- Bypass unnecessary GCS storage.buckets.get permission (PR [#516](https://github.com/RaRe-Technologies/smart_open/pull/516), [@gelioz](https://github.com/gelioz))

# 2.1.0, 1 July 2020

- Azure storage blob support ([@nclsmitchell](https://github.com/nclsmitchell) and [@petedannemann](https://github.com/petedannemann))
Expand Down
2 changes: 1 addition & 1 deletion smart_open/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def __init__(
if client is None:
client = google.cloud.storage.Client()

self._blob = client.get_bucket(bucket).get_blob(key) # type: google.cloud.storage.Blob
self._blob = client.bucket(bucket).get_blob(key) # type: google.cloud.storage.Blob

if self._blob is None:
raise google.cloud.exceptions.NotFound('blob %s not found in %s' % (key, bucket))
Expand Down

0 comments on commit d08f1ca

Please sign in to comment.