Skip to content

Commit 7f4bd40

Browse files
committed
always use a fresh cache root in FileSet.convert method
1 parent 690ba6c commit 7f4bd40

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fileformats/core/fileset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ def matching_exts(
502502
def convert(
503503
cls,
504504
fileset: "FileSet",
505-
cache_root: ty.Optional[Path] = None,
506505
**kwargs: ty.Any,
507506
) -> Self:
508507
"""Convert a given file-set into the format specified by the class
@@ -531,7 +530,9 @@ def convert(
531530
return copy(fileset)
532531
kwargs[converter.in_file] = fileset
533532
task = attrs.evolve(converter.task, **kwargs)
534-
outputs = task(cache_root=cache_root) # type: ignore[call-arg]
533+
# We need to use a fresh cache root each time to avoid picking up previous
534+
# conversions that no longer exist
535+
outputs = task(cache_root=tempfile.mkdtemp()) # type: ignore[call-arg]
535536
out_file = getattr(outputs, converter.out_file)
536537
if not isinstance(out_file, cls):
537538
out_file = cls(out_file)

0 commit comments

Comments
 (0)