| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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 modelcontextprotocol#1933 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks for the PR. Tracking this in #2040 instead. I'm closing this out as part of a backlog cleanup around the v2 release. Feel free to reopen if this is still relevant. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #1933. 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: I/O operation on closed file.
Changes
Test plan
Risk