Skip to content

smh_groom: an unlistable census sub-folder is an error, not a silent undercount - #8249

Closed
ne1i wants to merge 1 commit into
ItsNotRexed:mainfrom
ne1i:smh-groom-census-walk-error
Closed

ne1i wants to merge 1 commit into
ItsNotRexed:mainfrom
ne1i:smh-groom-census-walk-error

Conversation

@ne1i

@ne1i ne1i commented Nov 23, 2026

Copy link
Copy Markdown

smh_groom census <dir> walked the folder with plain os.walk, which silently skips a directory it cannot list. A census over a folder with an unreadable sub-folder reported "0 assets" (or fewer than there are) and exited 0.

The walk now passes onerror= with the _walk_error helper shape that #4342 (character_census), #4417 (vertex_types), #4418 (character_textures) and #4385 (save_keys) introduced, so main's existing OSError handler prints one ERROR: line and returns 1, this tool's own code for that case.

Tests: a chmod 000 sub-folder (skipped where chmod does not deny) and a mocked os.scandir failure for platforms where it cannot.

Tested on Linux, CPython 3.14, CPU only, synthetic folders: python -I tests/test_smh_groom.py 24 OK; with only the tool reverted, 2 failures (0 != 1). compileall, check_no_game_data.py and git diff --check are clean.

Claim: #8047.

AI-assisted (DeepSeek V4.1 Flash wrote it; reviewed and re-verified with Claude Code).

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown
Author

Closing as a duplicate: #8017 (opened 20 minutes before this one) makes the same change to the same os.walk call with the same onerror helper. I searched a cached list of PR titles that predated it and did not read my live search before opening this. Sorry for the noise; #8017 is the one to review.

AI-assisted.

@ne1i ne1i closed this Nov 23, 2026
@ne1i
ne1i deleted the smh-groom-census-walk-error branch November 23, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant