phenotypic.sdk_.atomic_write_text#
- phenotypic.sdk_.atomic_write_text(path: str | Path, text: str, *, encoding: str = 'utf-8') None[source]#
Atomically write
texttopath(temp sibling +os.replace).A drop-in replacement for
Path(path).write_text(text)that never leaves a half-written file: a concurrent reader sees either the old contents or the complete new ones, and an exception mid-write leaves any pre-existing file intact with no.tmpdebris.