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-storage version: 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.
Environment details
python --version: 3.9.0pip --version: 22.2.0google-cloud-storageversion:pip show google-cloud-storage: 2.6.0Steps to reproduce
Run the code example below, substituting a real bucket for
some-bucket.Code example
stream.closedshould return True afterstream.close()is called. I think it's probably returning False because BlobWriter is not callingsuper.close()and does not overrideIOBase.closed.BlobReader may have a similar problem, I haven't checked.