diff --git a/src/calibre/utils/fonts/scanner.py b/src/calibre/utils/fonts/scanner.py index d435e07a6e..626e01299c 100644 --- a/src/calibre/utils/fonts/scanner.py +++ b/src/calibre/utils/fonts/scanner.py @@ -368,6 +368,7 @@ class FontScanner(Thread): self.font_family_map, self.font_families = build_families(self.cached_fonts, self.folders) def write_cache(self): + # writing to the cache is atomic thanks to JSONConfig with self.cache: self.cache['version'] = self.CACHE_VERSION self.cache['fonts'] = self.cached_fonts