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 }}
Repository navigation
Document that S3Core copies of a delete-marker source version raise OSError(EINVAL) #1346
The S3Core docstring (s3_core.py:499-503) and docs/filesystem.md (:400-401) say that an operation raises FileNotFoundError for a missing object or version that it reads. S3Core.copy_object() and S3Core.upload_part_copy() with a source version that is a delete marker raise OSError(errno.EINVAL) instead.
Measured S3 behavior
Probed on a temporary versioned bucket (us-east-1) at 1a6a0d6:
405 with x-amz-delete-marker: true → FileNotFoundError since #1338
CopyObject, UploadPartCopy (as the copy source)
400 InvalidRequest, no x-amz-delete-marker header, message "The source of a copy request may not specifically refer to a delete marker by version id." → OSError(EINVAL)
A permanently removed (well-formed) version ID gives 404 NoSuchVersion → FileNotFoundError for HeadObject, GetObject, CopyObject and GetObjectTagging. A malformed version ID gives 400 InvalidArgument → OSError(EINVAL).
The filesystem is not affected: cp_file, copy and mv (sync and aio) look up the source with info() first, which raises FileNotFoundError.
Fix direction
Document the exception instead of translating it: the 400 response carries neither a header nor an error code specific to delete markers, so only its message distinguishes it. State in the S3Core docstring, the copy_object()/upload_part_copy() docstrings, and docs/filesystem.md that a copy source naming a delete-marker version raises OSError (EINVAL), and that the filesystem's copies raise FileNotFoundError because they look up the source first.
Activity
Name the two copy operations in the S3Core docstring (GH-1346)
Narrow the copy docs to what the copies raise (GH-1346)