Title: fix: set newline='' on TextIOWrapper in stdio_server to prevent Windows CRLF corruption by EvanYao826 · Pull Request #2574 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix: set newline='' on TextIOWrapper in stdio_server to prevent Windows CRLF corruption by EvanYao826 · Pull Request #2574 · modelcontextprotocol/python-sdk
X Title: fix: set newline='' on TextIOWrapper in stdio_server to prevent Windows CRLF corruption by EvanYao826 · Pull Request #2574 · modelcontextprotocol/python-sdk
Description: Fixes #2433 Summary On Windows, TextIOWrapper defaults to platform-native line endings ( ), which corrupts newline-delimited JSON-RPC messages over stdio. The server-side stdio_server() wraps sys.stdout in a TextIOWrapper without specifying newline=, so any in the JSON payload gets converted to , breaking clients that parse on . Fix Add newline= to the TextIOWrapper constructor in stdio_server(), matching the pattern already used in the server-side fix from PR #2302. Test Added a test verifying that the TextIOWrapper used in stdio_server has newline= set, preventing CRLF conversion.
Open Graph Description: Fixes #2433 Summary On Windows, TextIOWrapper defaults to platform-native line endings ( ), which corrupts newline-delimited JSON-RPC messages over stdio. The server-side stdio_server() wraps sys.s...
X Description: Fixes #2433 Summary On Windows, TextIOWrapper defaults to platform-native line endings ( ), which corrupts newline-delimited JSON-RPC messages over stdio. The server-side stdio_server() wraps sys.s...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2574
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7ebdab89-b460-2d1a-3aa5-ec9fb6f61c3d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C630:2658D0:61DB35C:86A150D:6A5E7D41 |
| html-safe-nonce | 0bd85e020276ce4c63d7fcf560c06046e0e0ab5d54e490e0062019196534b913 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjMwOjI2NThEMDo2MURCMzVDOjg2QTE1MEQ6NkE1RTdENDEiLCJ2aXNpdG9yX2lkIjoiNjI1MzQ0ODQ5MTg1NzUwOTY5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a51a46b092473800f825e5710a0a436bce6e011a18ab7457eed8ea6ec3de467e |
| hovercard-subject-tag | pull_request:3661629311 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2574/files |
| twitter:image | https://avatars.githubusercontent.com/u/155432245?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/155432245?s=400&v=4 |
| og:image:alt | Fixes #2433 Summary On Windows, TextIOWrapper defaults to platform-native line endings ( ), which corrupts newline-delimited JSON-RPC messages over stdio. The server-side stdio_server() wraps sys.s... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 71950bbe6bf7e15662b868c102fed9d1682c29a05970d9b2daa2e4dd3522c52e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7514606601325843bc1c464d2d8bf5fe9af2c154 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width