Skip to content

S3Client: Fix ETag KeyError when HeadObject omits ETag - #583

Merged
pjbull merged 2 commits into
drivendataorg:masterfrom
srstsavage:cloudpathlib-582-allow-headobject-missing-etag
Aug 22, 2026
Merged

S3Client: Fix ETag KeyError when HeadObject omits ETag#583
pjbull merged 2 commits into
drivendataorg:masterfrom
srstsavage:cloudpathlib-582-allow-headobject-missing-etag

Conversation

@srstsavage

Copy link
Copy Markdown
Contributor

Fix KeyError in S3Client._get_metadata when HeadObject response is missing the optional ETag property.

An example S3 server omitting ETag is versitygw when serving existing POSIX backends without metadata.

Closes #582


Contributor checklist:

  • I have read and understood CONTRIBUTING.md
  • Confirmed an issue exists for the PR, and the text Closes #issue appears in the PR summary (e.g., Closes #123).
  • Confirmed PR is rebased onto the latest base
  • Confirmed failure before change and success after change
  • Any generic new functionality is replicated across cloud providers if necessary
  • Tested manually against live server backend for at least one provider (Backblaze B2 S3 API, Minio, and versitygw)
  • Added tests for any new functionality
  • Linting passes locally
  • Tests pass locally
  • Updated HISTORY.md with the issue that is addressed and the PR you are submitting. If the top section is not `## UNRELEASED``, then you need to add a new section to the top of the document for your change.

Fix KeyError in S3Client._get_metadata when HeadObject response
is missing the optional ETag property.

An example S3 server omitting ETag is versitygw when serving
existing POSIX backends without metadata.
@srstsavage
srstsavage force-pushed the cloudpathlib-582-allow-headobject-missing-etag branch from 00787db to f10ec01 Compare August 21, 2026 05:47
@pjbull
pjbull merged commit e0b22b4 into drivendataorg:master Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

etag is not a required object property in the S3 API, but S3Client assumes it will always be present

2 participants