-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS type and version: Mac OS X 12.6
- Python version:
python --version: 3.9.0 - pip version:
pip --version: 22.2.0 google-cloud-storageversion:pip show google-cloud-storage: 2.6.0
Steps to reproduce
Run the code example below, substituting a real bucket for some-bucket.
Code example
from google.cloud import storage
client = storage.Client()
bucket = storage.Bucket.from_string("gs://some-bucket", client=client)
blob = bucket.blob('deleteme')
stream = blob.open(mode='w', ignore_flush=True)
stream.write("foobarbaz")
stream.close()
print(stream.closed) # --> False.stream.closed should return True after stream.close() is called. I think it's probably returning False because BlobWriter is not calling super.close() and does not override IOBase.closed.
BlobReader may have a similar problem, I haven't checked.
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.