From 68be8f71013dd582b909601d9cf1de7678bcad15 Mon Sep 17 00:00:00 2001 From: disqualifier Date: Mon, 6 Jul 2026 17:17:39 -0400 Subject: [PATCH] fix: _pid_alive treats an out-of-C-int-range pid as not alive (no OverflowError) os.kill(pid, 0) raises OverflowError for a pid too large for a C int, which _pid_alive did not catch; a foreign ..tmp file in the store dir then made every stale-tmp sweep (so every _save) crash. an over-range pid can't name a live process, so it's treated as not-alive like ProcessLookupError. Signed-off-by: disqualifier --- src/aiokv/aiokv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aiokv/aiokv.py b/src/aiokv/aiokv.py index 2a8ad04..d6edb4e 100644 --- a/src/aiokv/aiokv.py +++ b/src/aiokv/aiokv.py @@ -170,7 +170,8 @@ class AioKV: """check whether pid refers to a live process, without permission to signal counting as alive""" try: os.kill(pid, 0) - except ProcessLookupError: + except (ProcessLookupError, OverflowError): + # OverflowError: a pid too large for a C int can't name a live process return False except PermissionError: return True