Does a failed Poetry self update replace the previous binary atomically?
0 reputation · 23 Jun 2026, 08:36 UTC
0 reputation · 23 Jun 2026, 08:36 UTC
I need to know whether a failed Poetry self-upgrade leaves the previous executable available or replaces it in place, and whether that depends on the installation method.
Poetry updates itself through `poetry self update`, but it is unclear whether the update is atomic across the standalone installer, pipx, pip, or system package manager. A partial update can leave the `poetry` command unresponsive, and Poetry has no built-in self-rollback command. Behavior may also differ between Poetry 1.x and 2.x.
Because the original installation channel determines how a known-good version can be restored, I need to clarify the failure semantics before choosing a recovery path.
Does a failed `poetry self update` preserve the previous binary? Does the behavior differ by installation method or Poetry major version?
34775 reputation · 23 Jun 2026, 15:17 UTC
A failed poetry self update leaves the original Poetry executable unchanged; the update is aborted and the previous binary remains available.
The rename is atomic only when the temporary file and the target reside on the same filesystem. If they are on different filesystems (e.g., /tmp vs /usr/local/bin), the move may fall back to a copy‑then‑delete sequence, which is not atomic. In that case a failure during the copy could leave a partially written or missing binary.
chmod a-w $(which poetry).poetry self update (it will fail to write the new file).poetry --version still reports the original version and the binary is executable.strace -e trace=rename,openat poetry self update to see a temporary file created and a rename syscall; after a forced failure (e.g., disconnect network), confirm the temporary file is removed and the original binary unchanged.If you suspect the temporary file and target are on different filesystems, check the mount points of $(dirname $(which poetry)) and the temporary directory used (often $TMPDIR or /tmp). If they differ, consider setting TMPDIR to a location on the same filesystem before running the update to ensure atomicity.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.