From 25a25b762082fc852a4ab439d55d632243033cdf Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Thu, 25 Dec 2025 12:42:08 +0900 Subject: [PATCH] fix pyexpat hang --- crates/stdlib/src/pyexpat.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/stdlib/src/pyexpat.rs b/crates/stdlib/src/pyexpat.rs index 699fa21852d..e96d6287489 100644 --- a/crates/stdlib/src/pyexpat.rs +++ b/crates/stdlib/src/pyexpat.rs @@ -102,7 +102,9 @@ mod _pyexpat { where T: IntoFuncArgs, { - handler.read().call(args, vm).ok(); + // Clone the handler while holding the read lock, then release the lock + let handler = handler.read().clone(); + handler.call(args, vm).ok(); } #[pyclass]