Skip to content

feat: atomic_write helper (#157) - #159

Merged
thorwhalen merged 3 commits into
masterfrom
atomic-write-157
Oct 26, 2026
Merged

thorwhalen merged 3 commits into
masterfrom
atomic-write-157

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Closes #157

Adds dol.atomic_write(path, data, *, fsync=False, perms=None, tmp_suffix=".tmp", exclusive=True): write to a sibling temp file, then os.replace. data is bytes-like or an iterable of chunks. Purely additive (new leaf module dol/atomic.py, one new export); no existing behaviour touched. Starter code: xdol.util.atomic_write, config2py.util.atomic_write_bytes.

Tests: dol/tests/test_atomic.py + doctests; full suite 807 passed.

Review verdict: (pending, filled below)

@thorwhalen
thorwhalen merged commit 7ffbb30 into master Oct 26, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the atomic-write-157 branch October 26, 2026 15:32
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.

Shared atomic_write helper (write-temp-then-os.replace) for the fleet

1 participant