Fix DirEntry sort error in discover_files

Sort os.scandir() results by entry.name instead of comparing DirEntry objects directly, which don't support < operator.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
george
2026-06-06 01:04:14 +01:00
parent fc683b2803
commit 1b61af8873
+1 -1
View File
@@ -166,7 +166,7 @@ def discover_files(
def walk_and_collect(current: Path, rel_prefix: Path):
"""Recursive walk function."""
try:
for entry in sorted(os.scandir(current)):
for entry in sorted(os.scandir(current), key=lambda e: e.name):
entry_path = current / entry.name
rel_path = (rel_prefix / entry.name).replace("\\", "/") if str(rel_prefix) != "." else rel_prefix