René's URL Explorer Experiment


Title: Align Windows code-page codec errors with CPython by youknowdot · Pull Request #9849 · RustPython/RustPython · GitHub

Open Graph Title: Align Windows code-page codec errors with CPython by youknowdot · Pull Request #9849 · RustPython/RustPython

X Title: Align Windows code-page codec errors with CPython by youknowdot · Pull Request #9849 · RustPython/RustPython

Description: Summary Group Windows code-page codec compatibility fixes with the shared encoder error-handler validation they depend on: Preserve lone surrogates on the Windows UTF-16 input path (including UTF-7), and restore the upstream test_cp_utf7 test. Match CPython 3.15 whole-input strict error ranges (0..0) instead of inventing a failing-character range. Replace bespoke Windows encode/decode handler plumbing with the existing codec contexts. This preserves handler replacement/restart validation, registered handlers, and mutated decoder exception objects. Match CPython encoder handler __index__ conversion precedence and negative/overflow restart errors. Propagate unexpected Windows conversion failures instead of treating all OS failures as encoding errors. Route mbcs/OEM aliases through the same conversions, as CPython does, instead of silently ignoring handler/final arguments. Preserve original input length for final=True consumed results. This removes substantially more Windows-specific code than it adds. Regression cases extend the existing codec snippet; upstream tests are not duplicated or rewritten. Reference: CPython 3.15 Objects/unicodeobject.c, unicode_encode_call_errorhandler, encode_code_page_errors, decode_code_page_errors, and the Windows wchar decoder error handler. Independent source review also checked the deliberate surrogate-pair joining of the wchar decoder path. Validation so far Linux release build succeeded. -m test test_codecs: 288 tests, 14 existing platform/feature skips, passed. Adjacent test_codeccallbacks: 43 passed; test_str: 139 tests, 11 skips, passed. Existing stdlib_codecs_wide.py including new cases passed on RustPython and CPython 3.15; focused pytest: 2 passed. The new negative restart regression fails on the unmodified main binary (unsigned-wrapped position) and passes with this change. Workspace all-target Clippy completed; only existing must_use_candidate warnings in unmodified root entrypoints. Formatting, lint, and repository commit hooks passed. Windows GNU VM cross-check passed using Zig CC (with unrelated existing nt/os unused warnings). Full pytest under CPython 3.15 completed: 494 passed, 21 failed, 15 subtests passed. Failures are unavailable _ctypes/_lzma/_sqlite3 modules and sandbox-restricted OS/socket/multiprocessing operations. C-API tests: 149 passed, 2 ignored; C-API Clippy passed. Workspace unit tests were attempted but stopped during optimized compilation when the workspace ran out of disk space; no unit-test success is claimed. The stopped build’s new incomplete incremental artifacts were cleaned, without touching other work. The Windows-only while-let lint found by CI was fixed in the latest head; its CI rerun is pending. Real Windows execution and performance are not yet verified; keep this draft until CI establishes those results. The Linux skips are not evidence that Windows behavior passed.

Open Graph Description: Summary Group Windows code-page codec compatibility fixes with the shared encoder error-handler validation they depend on: Preserve lone surrogates on the Windows UTF-16 input path (including UTF-...

X Description: Summary Group Windows code-page codec compatibility fixes with the shared encoder error-handler validation they depend on: Preserve lone surrogates on the Windows UTF-16 input path (including UTF-...

Opengraph URL: https://github.com/RustPython/RustPython/pull/9849

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:32ab787c-fba7-d2db-f380-13842f95cd4a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8830:22DB35:370D03B:463F7E9:6B01DE70
html-safe-nonce74be7c644375b2836d2d42c35ecaf019baa1fe9b69521a55737b75acbf7f6970
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODMwOjIyREIzNTozNzBEMDNCOjQ2M0Y3RTk6NkIwMURFNzAiLCJ2aXNpdG9yX2lkIjoiMTMyNjU4Mzg4NzYzMTA4MTA3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb50b84f6d2d47e27c6cbd30fcaf1851c0f84b7e7058c2227e359b79bd0f69ab1
hovercard-subject-tagpull_request:5320349323
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9849/files
twitter:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
og:image:altSummary Group Windows code-page codec compatibility fixes with the shared encoder error-handler validation they depend on: Preserve lone surrogates on the Windows UTF-16 input path (including UTF-...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9849/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9849%2Ffiles
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%2FRustPython%2FRustPython%2Fpull%2F9849%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9849/files
Reloadhttps://github.com/RustPython/RustPython/pull/9849/files
Reloadhttps://github.com/RustPython/RustPython/pull/9849/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowdot:fix/windows-codepage-parityhttps://github.com/youknowdot/RustPython/tree/fix/windows-codepage-parity
Conversation 5 https://github.com/RustPython/RustPython/pull/9849
Commits 4 https://github.com/RustPython/RustPython/pull/9849/commits
Checks 28 https://github.com/RustPython/RustPython/pull/9849/checks
Files changed https://github.com/RustPython/RustPython/pull/9849/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9849/files
Align Windows code-page codec errors with CPython https://github.com/RustPython/RustPython/pull/9849/files#top
Show all changes 4 commits https://github.com/RustPython/RustPython/pull/9849/files
3c4361b Align Windows code-page error handling with CPython codex Nov 15, 2026 https://github.com/RustPython/RustPython/pull/9849/commits/3c4361b61a803fca93a2d05ba22eac73f18c83df
b49732c Share code-page conversion for mbcs and OEM aliases codex Nov 15, 2026 https://github.com/RustPython/RustPython/pull/9849/commits/b49732ce68439aeef322c35395d8d77946a9b350
3b165a9 Cover code-page aliases in existing handler regression codex Nov 15, 2026 https://github.com/RustPython/RustPython/pull/9849/commits/3b165a917a195ad405076ceba901c92531613176
fa8fff2 Use while-let for Windows encoder iteration codex Nov 15, 2026 https://github.com/RustPython/RustPython/pull/9849/commits/fa8fff28f032b92d3cad8408cfd79179c636ea7a
Clear filters https://github.com/RustPython/RustPython/pull/9849/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9849/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9849/files
test_codecs.py https://github.com/RustPython/RustPython/pull/9849/files#diff-a71f034c62318430dc94a9f744b5333e7d8eec577d3a23ab0b76a781872c9b96
codecs.rs https://github.com/RustPython/RustPython/pull/9849/files#diff-5cbadb2b300a5f24fb3fac28ebe23139a4015307b8f9100dff82423ecedf64b4
_codecs.rs https://github.com/RustPython/RustPython/pull/9849/files#diff-b2a9b9730c8278dc0964ea9e0b1fb0d3dc472e23ce20b5264bba3f1f6c585226
stdlib_codecs_wide.py https://github.com/RustPython/RustPython/pull/9849/files#diff-df0602b393096da9a8fc2f562042275fc9c05c41de86cc46e2e699b9a0b47df9
Lib/test/test_codecs.pyhttps://github.com/RustPython/RustPython/pull/9849/files#diff-a71f034c62318430dc94a9f744b5333e7d8eec577d3a23ab0b76a781872c9b96
View file https://github.com/youknowdot/RustPython/blob/fa8fff28f032b92d3cad8408cfd79179c636ea7a/Lib/test/test_codecs.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9849/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9849/files#diff-a71f034c62318430dc94a9f744b5333e7d8eec577d3a23ab0b76a781872c9b96
https://github.com/RustPython/RustPython/pull/9849/files#diff-a71f034c62318430dc94a9f744b5333e7d8eec577d3a23ab0b76a781872c9b96
crates/vm/src/codecs.rshttps://github.com/RustPython/RustPython/pull/9849/files#diff-5cbadb2b300a5f24fb3fac28ebe23139a4015307b8f9100dff82423ecedf64b4
View file https://github.com/youknowdot/RustPython/blob/fa8fff28f032b92d3cad8408cfd79179c636ea7a/crates/vm/src/codecs.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9849/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9849/files#diff-5cbadb2b300a5f24fb3fac28ebe23139a4015307b8f9100dff82423ecedf64b4
https://github.com/RustPython/RustPython/pull/9849/files#diff-5cbadb2b300a5f24fb3fac28ebe23139a4015307b8f9100dff82423ecedf64b4
https://github.com/RustPython/RustPython/pull/9849/files#diff-5cbadb2b300a5f24fb3fac28ebe23139a4015307b8f9100dff82423ecedf64b4
https://github.com/RustPython/RustPython/pull/9849/files#diff-5cbadb2b300a5f24fb3fac28ebe23139a4015307b8f9100dff82423ecedf64b4
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9849/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9849/files
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.