René's URL Explorer Experiment


Title: Test suite fails with UnicodeDecodeError on Windows with non-UTF-8 locale: read_text() calls missing encoding · Issue #3244 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: Test suite fails with UnicodeDecodeError on Windows with non-UTF-8 locale: read_text() calls missing encoding · Issue #3244 · modelcontextprotocol/python-sdk

X Title: Test suite fails with UnicodeDecodeError on Windows with non-UTF-8 locale: read_text() calls missing encoding · Issue #3244 · modelcontextprotocol/python-sdk

Description: Describe the bug On Windows systems where the ANSI code page is not UTF-8 (e.g. Chinese-locale Windows, code page 936 / GBK), running the test suite fails with UnicodeDecodeError in two places: tests/examples/conftest.py:41 - (STORIES_DI...

Open Graph Description: Describe the bug On Windows systems where the ANSI code page is not UTF-8 (e.g. Chinese-locale Windows, code page 936 / GBK), running the test suite fails with UnicodeDecodeError in two places: tes...

X Description: Describe the bug On Windows systems where the ANSI code page is not UTF-8 (e.g. Chinese-locale Windows, code page 936 / GBK), running the test suite fails with UnicodeDecodeError in two places: tes...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3244

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test suite fails with UnicodeDecodeError on Windows with non-UTF-8 locale: read_text() calls missing encoding","articleBody":"### Describe the bug\n\nOn Windows systems where the ANSI code page is not UTF-8 (e.g. Chinese-locale Windows, code page 936 / GBK), running the test suite fails with `UnicodeDecodeError` in two places:\n\n1. `tests/examples/conftest.py:41` - `(STORIES_DIR / manifest.toml).read_text()` fails during collection (8 collection errors, blocking all of `tests/examples`):\n\n```\ntests\\examples\\conftest.py:41: in \u003cmodule>\n    MANIFEST = tomllib.loads((STORIES_DIR / manifest.toml).read_text())\nE   UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 441: illegal multibyte sequence\n```\n\n2. `tests/examples/test_story_shape.py:30` - `_parse` reads story sources with `path.read_text()` (~70 test failures once collection succeeds):\n\n```\ntests\\examples\\test_story_shape.py:30: in _parse\n    return ast.parse(path.read_text(), filename=str(path))\nE   UnicodeDecodeError: 'gbk' codec can't decode byte 0x92 in position 1311: illegal multibyte sequence\n```\n\n`Path.read_text()` without an `encoding` argument uses `locale.getpreferredencoding()`, which is the ANSI code page on Windows (`cp936`/GBK on Chinese-locale systems, `cp1252` on Western-locale systems). The files being read (`manifest.toml`, story sources) are UTF-8 and contain non-ASCII bytes, so decoding fails. CI does not catch this because `windows-latest` runners use cp1252, which happens to decode those byte sequences without raising.\n\n### Expected behavior\n\nThe test suite passes regardless of the host locale. TOML is UTF-8 by specification, and the story sources are UTF-8, so both call sites should pass `encoding=utf-8` explicitly.\n\n### Environment\n\n- OS: Windows 10 (Chinese locale, ANSI code page 936/GBK)\n- Python: 3.11.14\n- SDK: main @ a4f4ccd\n\n### Additional context\n\nFix is two one-line changes adding `encoding=utf-8`; PR to follow.\n\nDisclosure: this bug was found and the fix prepared with AI assistance (Claude Code); the change has been reviewed and verified by me (full suite green on the affected machine: 5574 passed).","author":{"url":"https://github.com/ShuQingDollarVoyager","@type":"Person","name":"ShuQingDollarVoyager"},"datePublished":"2026-08-04T06:52:27Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3244"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:723bb434-baf5-de56-79a7-1ce56fc6aafd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAFF0:134361:66FACD:89CA63:6B00D3F7
html-safe-nonce749a9d0fc2895456e7e30c7efba2819f4f9c1d5ccf56cef0357b8fba90963bdd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkYwOjEzNDM2MTo2NkZBQ0Q6ODlDQTYzOjZCMDBEM0Y3IiwidmlzaXRvcl9pZCI6Ijc3MTMxNzQxMDQ3MjcxNDc1MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac115dd908251d0b9005836f98c2b8daa892f2f7b72f615f73915f8213099aef16
hovercard-subject-tagissue:5057610353
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3244/issue_layout
twitter:imagehttps://opengraph.githubassets.com/03f37a56b4509755a24721b796fdc49c9969cbe2f944feda1d1720b0151e3b45/modelcontextprotocol/python-sdk/issues/3244
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/03f37a56b4509755a24721b796fdc49c9969cbe2f944feda1d1720b0151e3b45/modelcontextprotocol/python-sdk/issues/3244
og:image:altDescribe the bug On Windows systems where the ANSI code page is not UTF-8 (e.g. Chinese-locale Windows, code page 936 / GBK), running the test suite fails with UnicodeDecodeError in two places: tes...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameShuQingDollarVoyager
hostnamegithub.com
expected-hostnamegithub.com
None85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4943239a6d2c591325dad6e5c313e1cafda877f6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3244#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3244
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3244
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3244
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3244
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3244
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues308 (308)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3244
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3244
#3245https://github.com/modelcontextprotocol/python-sdk/pull/3245
Test suite fails with UnicodeDecodeError on Windows with non-UTF-8 locale: read_text() calls missing encodinghttps://github.com/modelcontextprotocol/python-sdk/issues/3244#top
#3245https://github.com/modelcontextprotocol/python-sdk/pull/3245
P3Nice to haves, rare edge caseshttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
https://github.com/ShuQingDollarVoyager
ShuQingDollarVoyagerhttps://github.com/ShuQingDollarVoyager
on Aug 4, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3244#issue-5057610353
a4f4ccdhttps://github.com/modelcontextprotocol/python-sdk/commit/a4f4ccd091138771535e17191123f20b30fda68e
maxisbeyhttps://github.com/maxisbey
P3Nice to haves, rare edge caseshttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
on Aug 4, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3244#event-28943000748
maxisbeyhttps://github.com/maxisbey
completedhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3245https://github.com/modelcontextprotocol/python-sdk/pull/3245
on Aug 14, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3244#event-29451805001
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3244
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3244
P3Nice to haves, rare edge caseshttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.