From 165662b4b68669a4e0d690e2ce251aefd32a077a Mon Sep 17 00:00:00 2001 From: Tim Finnigan Date: Tue, 21 May 2024 11:18:24 -0700 Subject: [PATCH 1/2] add cache error message --- botocore/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botocore/utils.py b/botocore/utils.py index e2c5c17a00..32a3d44723 100644 --- a/botocore/utils.py +++ b/botocore/utils.py @@ -3510,7 +3510,7 @@ def __getitem__(self, cache_key): with open(actual_key) as f: return json.load(f) except (OSError, ValueError): - raise KeyError(cache_key) + raise KeyError(f'Cache file {actual_key} may be corrupt, please delete it.') def __delitem__(self, cache_key): actual_key = self._convert_cache_key(cache_key) From 1c76f357dc57dcf0947c948126009dfb414052ec Mon Sep 17 00:00:00 2001 From: Tim Finnigan Date: Tue, 21 May 2024 11:37:04 -0700 Subject: [PATCH 2/2] fix linting --- botocore/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/botocore/utils.py b/botocore/utils.py index 32a3d44723..fedc227b6c 100644 --- a/botocore/utils.py +++ b/botocore/utils.py @@ -3510,7 +3510,9 @@ def __getitem__(self, cache_key): with open(actual_key) as f: return json.load(f) except (OSError, ValueError): - raise KeyError(f'Cache file {actual_key} may be corrupt, please delete it.') + raise KeyError( + f'Cache file {actual_key} may be corrupt, please delete it.' + ) def __delitem__(self, cache_key): actual_key = self._convert_cache_key(cache_key)