We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d56cb41 commit 3fbc27fCopy full SHA for 3fbc27f
src/google/adk/skills/utils.py
@@ -36,9 +36,15 @@ def _load_dir(directory: pathlib.Path) -> dict[str, str]:
36
files = {}
37
if directory.exists() and directory.is_dir():
38
for file_path in directory.rglob("*"):
39
+ if "__pycache__" in file_path.parts:
40
+ continue
41
if file_path.is_file():
42
relative_path = file_path.relative_to(directory)
- files[str(relative_path)] = file_path.read_text(encoding="utf-8")
43
+ try:
44
+ files[str(relative_path)] = file_path.read_text(encoding="utf-8")
45
+ except UnicodeDecodeError:
46
+ # Binary files or non-UTF-8 files are skipped for text content.
47
48
return files
49
50
0 commit comments