From 1f9688e0ee0f55acf2108d30985e9005d349d315 Mon Sep 17 00:00:00 2001 From: Tao Peng Date: Mon, 25 Aug 2025 11:13:58 -0700 Subject: [PATCH 1/2] Use separate cache pathes for different python/CLI versions --- mapillary_tools/uploader.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mapillary_tools/uploader.py b/mapillary_tools/uploader.py index d11a9b14..6ff4bece 100644 --- a/mapillary_tools/uploader.py +++ b/mapillary_tools/uploader.py @@ -36,6 +36,7 @@ types, upload_api_v4, utils, + VERSION, ) from .camm import camm_builder, camm_parser from .gpmf import gpmf_parser @@ -799,8 +800,13 @@ def _maybe_create_persistent_cache_instance( LOG.debug("Dry-run mode enabled, skipping caching upload file handles") return None + # Different python/CLI versions use different cache (dbm) formats. + # Separate them to avoid conflicts + version = f"py_{'_'.join(map(str, sys.version_info))}_{VERSION}" + cache_path_dir = ( Path(constants.UPLOAD_CACHE_DIR) + .joinpath(version) .joinpath(api_v4.MAPILLARY_CLIENT_TOKEN.replace("|", "_")) .joinpath( user_items.get("MAPSettingsUserKey", user_items["user_upload_token"]) @@ -812,6 +818,7 @@ def _maybe_create_persistent_cache_instance( # Sanitize sensitive segments for logging sanitized_cache_path = ( Path(constants.UPLOAD_CACHE_DIR) + .joinpath(version) .joinpath("***") .joinpath("***") .joinpath("cached_file_handles") From 9c57be34ab04371f9083d6266f42fc10061e34f6 Mon Sep 17 00:00:00 2001 From: Tao Peng Date: Mon, 25 Aug 2025 11:21:50 -0700 Subject: [PATCH 2/2] fix --- mapillary_tools/uploader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mapillary_tools/uploader.py b/mapillary_tools/uploader.py index 6ff4bece..8b2e2ad3 100644 --- a/mapillary_tools/uploader.py +++ b/mapillary_tools/uploader.py @@ -802,7 +802,8 @@ def _maybe_create_persistent_cache_instance( # Different python/CLI versions use different cache (dbm) formats. # Separate them to avoid conflicts - version = f"py_{'_'.join(map(str, sys.version_info))}_{VERSION}" + py_version_parts = [str(part) for part in sys.version_info[:3]] + version = f"py_{'_'.join(py_version_parts)}_{VERSION}" cache_path_dir = ( Path(constants.UPLOAD_CACHE_DIR)