René's URL Explorer Experiment


Title: Snapshot startup filesystem encoding on Linux by youknowdot · Pull Request #9689 · RustPython/RustPython · GitHub

Open Graph Title: Snapshot startup filesystem encoding on Linux by youknowdot · Pull Request #9689 · RustPython/RustPython

X Title: Snapshot startup filesystem encoding on Linux by youknowdot · Pull Request #9689 · RustPython/RustPython

Description: Summary Initialize the Linux command-line locale with CPython 3.15's environment precedence and PEP 538 coercion. Keep embedded startup non-mutating; the executable explicitly opts into the unsafe, single-threaded process-startup contract. Snapshot filesystem encoding in interpreter configuration. Share the fixed configuration with subinterpreters, keep Python codec objects local to each interpreter, and preserve filesystem behavior after later LC_CTYPE changes. Reuse native UTF-8, ASCII and Latin-1 codecs. GNU Linux uses an owned locale snapshot for wider-codec bootstrap, then switches to the initialized codec registry. Make filesystem decoding fallible throughout startup and OS-facing callers. Preserve Python exceptions, retain accepted sockets until address conversion succeeds, and close received ancillary descriptors if conversion fails. Stop using frozen filesystem encoding for the internal current-locale conversion helper. This addresses the runtime cause behind the Linux test_utf8_mode.UTF8ModeTests.test_cmd_line expected failure. No test code or decorators are changed because a RustPython runtime pass is not yet available. CPython reference Compared against CPython v3.15.0: Locale preconfiguration PEP 538 startup coercion Native locale conversion Filesystem codec initialization Validation Passed cargo check -p rustpython --lib --bin rustpython. Passed strict Clippy: cargo clippy -p rustpython-host_env -p rustpython-vm -p rustpython-stdlib -p rustpython --lib --bin rustpython -- -D warnings. Passed no-host VM compilation: cargo check -p rustpython-vm --no-default-features --features compiler. Normal commit hooks passed. An out-of-tree, bounded host-helper probe passed 40 decode/encode roundtrips across C, C.UTF-8, ISO-8859-1, ISO-8859-5 and GB2312, including embedded NUL and malformed/incomplete input. Snapshot stability after changing LC_CTYPE and typed encoding errors passed. Fifteen host-helper startup cases matched CPython 3.15.0 output and warning stderr exactly, including environment precedence, ignored Python controls, coercion warnings, invalid locale settings and LC_NUMERIC behavior. Unmodified CPython 3.15.0 test_cmd_line and test_filesystemencoding reference cases passed. Separate source review completed. No repository test additions, skips or expected-failure removals. The host-helper probe does not execute RustPython's VM or interpreter. Local RustPython runtime and aggregate workspace/C-API suites were not run because no verified runtime guard is available. This draft needs hosted CI and runtime review. Only the GNU Linux Rust target is installed; Windows/WASI call sites were source-reviewed but not cross-compiled. Scope and integration Non-Linux filesystem behavior is preserved. Non-GNU Linux supports existing native fast codecs and retains its previous UTF-8 behavior for wider CODESETs. This does not add arbitrary embedded filesystem-codec overrides, Windows legacy mbcs support, complete raw -m parsing, or non-UTF-8 getpath configuration strings. VirtualMachine::fsdecode and dependent Rust path-result helpers now return PyResult; embedding callers must propagate errors. check_initialization lets embedded callers inspect startup failures without diagnostics or process exit. This overlaps #9688 (native script filenames). A disposable composition of current main 9d657b02e4, #9688 and this patch passed cargo check -p rustpython --lib --bin rustpython after resolving the cant_open_file overlap and propagating four additional fsdecode results in src/lib.rs and crates/vm/src/vm/python_run.rs. Those merge-time adjustments are prepared separately; neither standalone branch includes the other PR. AI assistance This is maintainer-directed Python 3.15 upgrade work. OpenAI Codex assisted with investigation, implementation, source review and validation. Model version was not exposed. No human runtime validation is claimed. Summary by CodeRabbit Bug Fixes Filesystem path and locale-based text conversion errors are now reported across file, socket, and system operations instead of being silently ignored. Interpreter and subinterpreter startup now report initialization failures rather than continuing with incomplete setup. Socket message handling closes received file descriptors if address conversion fails. New Features Added locale-aware filesystem encoding support on Linux, including optional locale initialization during startup and improved handling of legacy locales.

Open Graph Description: Summary Initialize the Linux command-line locale with CPython 3.15's environment precedence and PEP 538 coercion. Keep embedded startup non-mutating; the executable explicitly opts into the un...

X Description: Summary Initialize the Linux command-line locale with CPython 3.15's environment precedence and PEP 538 coercion. Keep embedded startup non-mutating; the executable explicitly opts into th...

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

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:33289c32-190d-a8d4-a1ac-295e67b55c84
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idECC0:25F5AB:EDF69:130092:6B01FE27
html-safe-noncef66f91893e48bd30e0c9c90020bbebc320863382c1b2744ef96a4da5e70daf1d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0MwOjI1RjVBQjpFREY2OToxMzAwOTI6NkIwMUZFMjciLCJ2aXNpdG9yX2lkIjoiOTg5OTEyODkwMzM1MTY1OTkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3c2ee5679813a5b557e1ee74002682c4f3b747c0acb779ebc9e58796e94c0dd2
hovercard-subject-tagpull_request:5147864643
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/9689/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 Initialize the Linux command-line locale with CPython 3.15's environment precedence and PEP 538 coercion. Keep embedded startup non-mutating; the executable explicitly opts into the un...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9689/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9689%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%2F9689%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/9689/files
Reloadhttps://github.com/RustPython/RustPython/pull/9689/files
Reloadhttps://github.com/RustPython/RustPython/pull/9689/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/startup-locale-filesystem-20261104https://github.com/youknowdot/RustPython/tree/fix/startup-locale-filesystem-20261104
Conversation 10 https://github.com/RustPython/RustPython/pull/9689
Commits 4 https://github.com/RustPython/RustPython/pull/9689/commits
Checks 28 https://github.com/RustPython/RustPython/pull/9689/checks
Files changed https://github.com/RustPython/RustPython/pull/9689/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9689/files
Snapshot startup filesystem encoding on Linux https://github.com/RustPython/RustPython/pull/9689/files#top
Show all changes 4 commits https://github.com/RustPython/RustPython/pull/9689/files
2220f4a Freeze startup filesystem locale codecs youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9689/commits/2220f4a704750f17b73713ee499a6103c9b8d0da
5c6df87 Retire the passing Linux UTF-8 command-line expectation youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9689/commits/5c6df87f723e53643e628b28614e841e14609c6d
f80f2c7 Explain platform-dependent socket address fallibility youknowdot Nov 5, 2026 https://github.com/RustPython/RustPython/pull/9689/commits/f80f2c724cca40edafedd69ae67b9e1eecbf1fd3
c73a45f Propagate filesystem decoding errors in new file runners youknowdot Nov 5, 2026 https://github.com/RustPython/RustPython/pull/9689/commits/c73a45f6dda289ca6f7b357d0c9bf0d420d6433d
Clear filters https://github.com/RustPython/RustPython/pull/9689/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9689/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9689/files
test_utf8_mode.py https://github.com/RustPython/RustPython/pull/9689/files#diff-6cbc672f27856c0602c2f76f0a9996de6ba46624e4451d8c40d739f9d5bc1715
locale.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-798379dfb19a491e0c442f8cf72284b966e32d4cce542c2748e0d62e5e3f850f
openssl.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-f66827d3199bc9476282bcbb77615622c5ef8eca6515c5671b29d39577333390
socket.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-184374c26b267e900965c88a05d2c963f9c2fcdc8419201b0fa39b9ed462b5c7
codecs.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-5cbadb2b300a5f24fb3fac28ebe23139a4015307b8f9100dff82423ecedf64b4
ospath.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-1cf45cec6bacee0bfacaa85cc92fd92e8c7059381eb63f37a695291fc46774fa
ospath_fd.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-2c0511e403c9ea6332d1e272863bd7bf4eac6213c4db85ddeb56a6f5d0f23ecc
_ctypes.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-d2bf8c03d89a90728436dbecb8b7f929c67d08ff5d6e18b2a0fc279e8fe77a8d
_symtable.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-7477e9e4591858e6d4081901083139369e38ed09031c4fd7b741e3847cbe69c3
_testinternalcapi.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-696e7f5e9d8e7d68b319536976bd29f52b43c3e368850ce083ef75ae0bf9785b
_thread.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-0006354bf5c0b6258c334f326e9c125eae4c55e8dae289a4990e76d7503885cb
nt.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-b6dbcd2c4153830809b8a9bda455dd41046ee3d8db21e0e79b636a15dde0d936
os.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
posix.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-8a094b07fd40ee7a3b9e440782ded748539a5214c242b6b3438421fe0d616c6e
posix_compat.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-a9c143cbdfa49e86335b886d96cb054a6c9e103d340641a00a43de92f7256d97
sys.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-e7f7c10b81f88d7af77af76257284e18e72ed9da63ff63675a9e9cb31c8d262d
filesystem.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-e451dea4b0fd6237675b7832e7becffc735cacbaa32df6b896e5c60b7a87f9f8
interpreter.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-2361f366cc46771907dbd3b09eb8b9c839e7f059710345f2265c1753862a1b20
mod.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-fe30ecf7c6b462e46e0874a55a05ea0edba83cefad5ac7a86e7137fa8f86ba74
python_run.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-ff5741056db5c8cfe1e330b23fb0ff523b4c9dcd7c4d86e3383d6abdba80713c
setting.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-9fc754581ca0739d7d6441cd6c1ce8bdd83220b0e7f71517c33aaffb622390f5
lib.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759
main.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fc
settings.rs https://github.com/RustPython/RustPython/pull/9689/files#diff-4f91d834bba4a3a432715f3ccf4ebc7c10d7ecfb974f1e78f56108dd80581a53
Lib/test/test_utf8_mode.pyhttps://github.com/RustPython/RustPython/pull/9689/files#diff-6cbc672f27856c0602c2f76f0a9996de6ba46624e4451d8c40d739f9d5bc1715
View file https://github.com/youknowdot/RustPython/blob/c73a45f6dda289ca6f7b357d0c9bf0d420d6433d/Lib/test/test_utf8_mode.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9689/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9689/files#diff-6cbc672f27856c0602c2f76f0a9996de6ba46624e4451d8c40d739f9d5bc1715
https://github.com/RustPython/RustPython/pull/9689/files#diff-6cbc672f27856c0602c2f76f0a9996de6ba46624e4451d8c40d739f9d5bc1715
crates/host_env/src/locale.rshttps://github.com/RustPython/RustPython/pull/9689/files#diff-798379dfb19a491e0c442f8cf72284b966e32d4cce542c2748e0d62e5e3f850f
View file https://github.com/youknowdot/RustPython/blob/c73a45f6dda289ca6f7b357d0c9bf0d420d6433d/crates/host_env/src/locale.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9689/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9689/files#diff-798379dfb19a491e0c442f8cf72284b966e32d4cce542c2748e0d62e5e3f850f
crates/stdlib/src/openssl.rshttps://github.com/RustPython/RustPython/pull/9689/files#diff-f66827d3199bc9476282bcbb77615622c5ef8eca6515c5671b29d39577333390
View file https://github.com/youknowdot/RustPython/blob/c73a45f6dda289ca6f7b357d0c9bf0d420d6433d/crates/stdlib/src/openssl.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9689/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9689/files#diff-f66827d3199bc9476282bcbb77615622c5ef8eca6515c5671b29d39577333390
https://github.com/RustPython/RustPython/pull/9689/files#diff-f66827d3199bc9476282bcbb77615622c5ef8eca6515c5671b29d39577333390
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9689/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9689/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.