You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(server): duplicate stdio fds to prevent closing real stdio
When using transport="stdio", the async wrappers around sys.stdin/sys.stdout
would close the underlying file descriptors on server exit, causing
subsequent operations like print() to fail with ValueError.
Use os.dup() to duplicate the file descriptors before wrapping, so
closing the async wrappers does not affect the original stdio streams.
Fall back to the original behavior when the stream lacks a real fd
(e.g. BytesIO in tests).
Fixes#1933
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments