Repository navigation
Conversation
…mkstemp's 0600 _write_json_atomic stages the JSON through tempfile.mkstemp, which creates the file 0600, and os.replace()s it into place without restoring the mode. A new report came out 0600 instead of the umask's bits, and a re-run reset a 0640 report to 0600. Give the staged file file_mode.published_mode(out) before the replace, as the other staged writers do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
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.
Claimed in the coordination issue (claim).
_write_json_atomicintools/fog_volumes.pystages its output in a private temporary file (tempfilecreates it 0600) andos.replace()s it into place without restoring the mode. So:open()gives under the umask (0644 under umask 022);tools/file_mode.pyexists for exactly this and is used by the other staged writers (#1082). This callsos.chmod(tmp, published_mode(dest))before the replace, as they do.Test: two new tests in
tests/test_fog_volumes.py, both built by hand (no game data): a new output getsfile_mode.new_file_mode(dir), and a replaced 0640 output stays 0640. Both fail onmain(384 != 420/384 != 416) and pass with this change.Ran (Linux, Python 3.14.8, CPU only):
python -I tests/test_fog_volumes.py: passpython -m compileall -q make_game.py tools tests: passpython -I scripts/check_no_game_data.pyon the changed files: passSkipped on Windows (
os.name == "nt"), where the POSIX bits don't apply. Same bug class as thetimecycle_pairs(#7572) andshader_disasm(#7573) PRs, but in different files, so the PRs don't overlap.AI-assisted (Claude Code).
🤖 Generated with Claude Code