Repository navigation
Collect PublishTest in direct runs / 修复 PublishTest 直接运行时的收集 - #2
Open
tahffo68hk-hash wants to merge 5 commits into
Conversation
bvh_index, navmesh_index and rbf0_tree give the staging file the destination mode before os.replace. On Windows a read-only destination makes the replace fail and leaves a temp that cannot be unlinked. Restore 0600 in the failure path before unlink, and add regressions that pin the mode reset, old bytes and no leftovers.
write_manifest gives its mkstemp file the destination mode before os.replace. With a read-only destination the failed replace left that temp unlinkable on Windows; restore 0600 in the failure path and add a synthetic regression.
rtti_scan, shader_link_check and classify_carve give their staging file the destination's mode just before os.replace, so a read-only destination makes the replace fail and leaves a readable-only temp that Windows will not unlink. shader_link_check was worse: its finally-block unlink raised and replaced the real error. Share one discard_staged() helper in file_mode.py (clear the read-only bit, ignore cleanup errors) and add a regression per module; each one fails against main's code. rpf9_names has the same shape but stages inside a TemporaryDirectory, whose cleanup already clears read-only bits, so it needs no change.
Appending the class after unittest.main() left the read-only replace regression unrun by python -I tests/test_classify_carve.py (26 tests, not 27); only pytest collected it. Move it above the guard so both runners see it. AI-assisted.
Follow-up to ItsNotRexed#4516. Both direct execution and unittest discovery pass 46 tests on Windows. AI-assisted.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
bobcatchris
force-pushed
the
fix/readonly-temp-cleanup
branch
3 times, most recently
from
November 23, 2026 15:51
34ddf34 to
500b0ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
Follow-up to ItsNotRexed/Leonida#4516. Move the
__main__block to the end oftests/test_shader_link_check.pyso direct execution collectsPublishTest. Coordination claim.Verified on Windows 11 with CPython 3.13.12:
python -I -B tests/test_shader_link_check.py -v— 46 passed.python -I -B -m unittest discover -s tests -p test_shader_link_check.py -v— 46 passed.git diff --check— clean.AI-assisted. Synthetic fixtures only.
中文
跟进 ItsNotRexed/Leonida#4516。将
tests/test_shader_link_check.py的__main__块移到文件末尾,使直接运行也能收集PublishTest。协调页认领。已在 Windows 11 和 CPython 3.13.12 上验证:
python -I -B tests/test_shader_link_check.py -v— 46 项通过。python -I -B -m unittest discover -s tests -p test_shader_link_check.py -v— 46 项通过。git diff --check— 通过。AI-assisted(使用了 AI 辅助)。Synthetic fixtures only(仅使用合成测试数据)。