Skip to content

Commit d3eec57

Browse files
committed
binary_cache
1 parent 881d4c2 commit d3eec57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/azure-cli-core/azure/cli/core/auth/binary_cache.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ def load(self):
4242
logger.debug("load: %s", self.filename)
4343
try:
4444
self.data = self._load()
45-
except (pickle.UnpicklingError, EOFError) as ex:
46-
# We still get exception after retry:
45+
except Exception as ex: # pylint: disable=broad-exception-caught
46+
# If we still get exception after retry, ignore all types of exceptions and use a new cache.
4747
# - pickle.UnpicklingError is caused by corrupted cache file, perhaps due to concurrent writes.
4848
# - EOFError is caused by empty cache file created by other az instance, but hasn't been filled yet.
49+
# - AttributeError is caused by reading cache generated by different MSAL versions.
4950
logger.debug("Failed to load cache: %s. Using a fresh one.", ex)
5051
self.data = {} # Ignore a non-existing or corrupted http_cache
5152

0 commit comments

Comments
 (0)