From fd652941536a4013d6195a673c5d406ff892949e Mon Sep 17 00:00:00 2001 From: Cal Nightingale Date: Thu, 19 Feb 2026 10:00:01 -0500 Subject: [PATCH 1/2] Fix _metadata AttributeError in CODObject.__init__ Initialize self._metadata = None before locker.acquire(), which calls get_metadata() -> _get_metadata() that accesses self._metadata. Without this, all write/append/read mode CODObject construction crashes with AttributeError: 'CODObject' object has no attribute '_metadata'. Co-Authored-By: Claude Opus 4.6 --- cloud_optimized_dicom/cod_object.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloud_optimized_dicom/cod_object.py b/cloud_optimized_dicom/cod_object.py index 9cac88f..3e29504 100644 --- a/cloud_optimized_dicom/cod_object.py +++ b/cloud_optimized_dicom/cod_object.py @@ -128,6 +128,8 @@ def __init__( raise ErrorLogExistsError( f"Cannot initialize; error log exists: {self.error_log_uri}" ) + # Initialize _metadata before locker, since acquire() calls get_metadata() + self._metadata = None # Only acquire lock for write/append mode WITH sync_on_exit=True # sync_on_exit=False means no lock (efficient for testing) self._locker = None From 0619931c99967ee4c65ec636d903884c6971b547 Mon Sep 17 00:00:00 2001 From: Cal Nightingale Date: Thu, 19 Feb 2026 10:02:52 -0500 Subject: [PATCH 2/2] Bump version to 0.2.4 Co-Authored-By: Claude Opus 4.6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0bbbfda..2edb18f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "cloud-optimized-dicom" -version = "0.2.3" +version = "0.2.4" description = "A library for efficiently storing and interacting with DICOM files in the cloud" readme = "README.md" authors = [