@@ -82,7 +82,7 @@ def _get_cache_filename(self) -> Path:
8282 / f"cache.{ f'{ docstring_trailing_line } _{ format_python_code_blocks } _{ include_txt } _{ line_length } _{ mode } ' } .pickle"
8383 )
8484
85- def _read_cache (self ) -> dict [Path , tuple [float , int ]]:
85+ def _read_cache (self ) -> dict [str , tuple [float , int ]]:
8686 """Read the cache file."""
8787 cache_file = self ._get_cache_filename ()
8888 if not cache_file .exists ():
@@ -101,9 +101,12 @@ def gen_todo_list(self, files: list[str]) -> tuple[set[Path], set[Path]]:
101101 """Generate the list of files to process."""
102102 todo , done = set (), set ()
103103 for file in (Path (f ).resolve () for f in files ):
104- if self .cache .get (file ) != self ._get_file_info (file ) or self .ignore_cache :
104+ if (
105+ self .cache .get (str (file )) != self ._get_file_info (file )
106+ or self .ignore_cache
107+ ):
105108 todo .add (file )
106- else : # pragma: no cover
109+ else :
107110 done .add (file )
108111 return todo , done
109112
@@ -114,7 +117,7 @@ def write_cache(self, files: list[Path]) -> None:
114117 self .cache_dir .mkdir (parents = True , exist_ok = True )
115118 new_cache = {
116119 ** self .cache ,
117- ** {file .resolve (): self ._get_file_info (file ) for file in files },
120+ ** {str ( file .resolve () ): self ._get_file_info (file ) for file in files },
118121 }
119122 with tempfile .NamedTemporaryFile (
120123 dir = str (cache_file .parent ), delete = False
0 commit comments