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:
@@ -166,7 +166,7 @@ def discover_files(
|
|||||||
def walk_and_collect(current: Path, rel_prefix: Path):
|
def walk_and_collect(current: Path, rel_prefix: Path):
|
||||||
"""Recursive walk function."""
|
"""Recursive walk function."""
|
||||||
try:
|
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
|
entry_path = current / entry.name
|
||||||
rel_path = (rel_prefix / entry.name).replace("\\", "/") if str(rel_prefix) != "." else rel_prefix
|
rel_path = (rel_prefix / entry.name).replace("\\", "/") if str(rel_prefix) != "." else rel_prefix
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user