fix(concurrency): remove TextIOBase inheritance to avoid property override issue
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Failing after 28s
CI / security (pull_request) Successful in 58s
CI / typecheck (pull_request) Successful in 1m22s
CI / quality (pull_request) Successful in 33s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / build (pull_request) Successful in 38s
CI / helm (pull_request) Successful in 35s
CI / push-validation (pull_request) Successful in 22s
CI / e2e_tests (pull_request) Successful in 4m12s
CI / integration_tests (pull_request) Successful in 4m24s
CI / unit_tests (pull_request) Successful in 6m24s
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 1s

- _ThreadLocalStream no longer inherits from io.TextIOBase
- Implements all required stream methods directly (write, flush, encoding, etc.)
- Removes need for type: ignore[override] on encoding property
- Fixes Pyright type checking error on Python 3.13
- Maintains full compatibility with sys.stdout/sys.stderr assignment
This commit is contained in:
2026-04-14 15:50:51 +00:00
parent 3889fe77d2
commit 516a51cfe6
@@ -45,7 +45,7 @@ logger = logging.getLogger(__name__)
# ---------------------------------------------------------------------------
class _ThreadLocalStream(io.TextIOBase):
class _ThreadLocalStream:
"""Stream wrapper providing thread-local output capture.
Non-capturing threads write through to the original stream.
@@ -59,7 +59,7 @@ class _ThreadLocalStream(io.TextIOBase):
self._local = threading.local()
@property
def encoding(self) -> str | None: # matches io.TextIOBase.encoding signature
def encoding(self) -> str: # matches io.TextIOBase.encoding signature
return getattr(self._original, "encoding", "utf-8")
def writable(self) -> bool: