Skip to content

fix: use atomic writes for composed preset command files - #3974

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/presets-composed-file-atomic-write
Open

fix: use atomic writes for composed preset command files#3974
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/presets-composed-file-atomic-write

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Problem

Three write_text() calls for composed command files were not atomic. A crash mid-write leaves a partial .md file which can cause errors when the command is later read.

Fix

Now uses a shared _atomic_write_text helper with empfile.mkstemp + os.replace.

Three write_text() calls for composed command files were not atomic.
A crash mid-write leaves a partial .md file which can cause errors
when the command is later read. Now uses a shared _atomic_write_text
helper with tempfile.mkstemp + os.replace.
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