From e79f591d703f65fd6347e93d3555880a33fe75ef Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 25 May 2025 05:20:35 +0000 Subject: [PATCH] Fix Python 3.10 segmentation fault in FilteredStream threading - Remove race condition in FilteredStream.write() method - Remove class-level _lock = None that caused threading issues - Ensures proper lock initialization in __init__ only Fixes Python 3.10 CI test failures with exit code 139 Co-Authored-By: Joe Moura --- src/crewai/llm.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/crewai/llm.py b/src/crewai/llm.py index 440cbf903..5f8a3a37e 100644 --- a/src/crewai/llm.py +++ b/src/crewai/llm.py @@ -56,16 +56,11 @@ load_dotenv() class FilteredStream(io.TextIOBase): - _lock = None - def __init__(self, original_stream: TextIO): self._original_stream = original_stream self._lock = threading.Lock() def write(self, s: str) -> int: - if not self._lock: - self._lock = threading.Lock() - with self._lock: # Filter out extraneous messages from LiteLLM if (