You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
When an error occurs during a multipart upload, BlobWriter.__exit__ is called with exception context. When that is the case, the multipart upload should be aborted. Currently, BlobWriter.__exit__blindly callsBlobWriter.close, which in turn finishes (commits) the multipart upload. The user then ends up with a partial blob on gcs, whereas the multipart upload should have been aborted.
raise an error that should result in aborting the upload
Code example
withblob.open('wb') asfp:
fp.write(b'first chunk') # not yet uploadedfp.write(b'big chunk'*1024**8) # uploadedraiseValueError('SIGTERM received')
# the new blob should not have been created on gcs
Hi 👋
When an error occurs during a multipart upload,
BlobWriter.__exit__is called with exception context. When that is the case, the multipart upload should be aborted. Currently,BlobWriter.__exit__blindly callsBlobWriter.close, which in turn finishes (commits) the multipart upload. The user then ends up with a partial blob on gcs, whereas the multipart upload should have been aborted.Steps to reproduce
BlobWriterCode example
For reference:
smart_open.s3.MultiPartWriter.__exit__