Skip to content

Commit 52a3438

Browse files
committed
fix(base): cast paths to tuple in read_files to prevent Pydantic generator exhaustion
1 parent 76e7c27 commit 52a3438

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

malariagen_data/anoph/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ def read_files(
233233
paths: Iterable[str],
234234
on_error: Literal["raise", "omit", "return"] = "return",
235235
) -> Mapping[str, Union[bytes, Exception]]:
236+
# Pydantic validate_call with strict=True converts Iterable into a
237+
# generator, which can be exhausted. Convert to a tuple first.
238+
paths = tuple(paths)
239+
236240
# Check for any cached files.
237241
files = {
238242
path: data for path, data in self._cache_files.items() if path in paths

0 commit comments

Comments
 (0)