René's URL Explorer Experiment


Title: Decouple FileIO from the os and msvcrt modules by youknowone · Pull Request #9843 · RustPython/RustPython · GitHub

Open Graph Title: Decouple FileIO from the os and msvcrt modules by youknowone · Pull Request #9843 · RustPython/RustPython

X Title: Decouple FileIO from the os and msvcrt modules by youknowone · Pull Request #9843 · RustPython/RustPython

Description: Split out of the review of #9833: the parts that are independent of the WASM host ABI. Move FileIO mode parsing into host_env/src/file_mode.rs; the native and unsupported io backends had identical copies. A repeated b ('rbb') is now accepted on every target, matching CPython. FileIO.truncate calls crt_fd::ftruncate and FileIO.__init__ calls host_env::msvcrt::setmode_binary directly. The os::ftruncate_borrowed and msvcrt::setmode_binary wrappers that only served FileIO are removed. A failed FileIO path open reports the original argument as OSError.filename (CPython: PyErr_SetFromErrnoWithFilenameObject(..., nameobj)), so e.filename is pathlike holds. os.open is unchanged, since CPython reports the __fspath__() result there. Checks: extra_tests/snippets/stdlib_io.py (new regression checks), -m test test_io.test_fileio test_io.test_file, clippy, fmt, wasip1 check. 🤖 Generated with Claude Code Summary by CodeRabbit Bug Fixes File-open errors now preserve the original path argument in the reported filename, including when the path is provided as a string, bytes, or a path-like value. Opening a file with repeated binary-mode markers reports the normalized mode. Refactor File-mode parsing and related behavior are now shared across supported host environments.

Open Graph Description: Split out of the review of #9833: the parts that are independent of the WASM host ABI. Move FileIO mode parsing into host_env/src/file_mode.rs; the native and unsupported io backends had identical...

X Description: Split out of the review of #9833: the parts that are independent of the WASM host ABI. Move FileIO mode parsing into host_env/src/file_mode.rs; the native and unsupported io backends had identical...

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

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:65ed1997-bd5c-e769-5529-0ef383185286
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB080:2E5652:33C2188:41FB7D7:6B01DE5B
html-safe-nonce6600cf1927309d49235bf073041d17a864bd3071044850be358c337fb4d69f5f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDgwOjJFNTY1MjozM0MyMTg4OjQxRkI3RDc6NkIwMURFNUIiLCJ2aXNpdG9yX2lkIjoiMjI0NTIwMDI2MzIyMjc3OTQ4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf46217f464885c278db1f468ef8a9446c90a8b787163aef8e7ad4e1423406028
hovercard-subject-tagpull_request:5314758249
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/9843/files
twitter:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
og:image:altSplit out of the review of #9833: the parts that are independent of the WASM host ABI. Move FileIO mode parsing into host_env/src/file_mode.rs; the native and unsupported io backends had identical...
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-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9843/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9843%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%2F9843%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/9843/files
Reloadhttps://github.com/RustPython/RustPython/pull/9843/files
Reloadhttps://github.com/RustPython/RustPython/pull/9843/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
youknowone:fileio-host-decouplehttps://github.com/youknowone/RustPython/tree/fileio-host-decouple
Conversation 3 https://github.com/RustPython/RustPython/pull/9843
Commits 1 https://github.com/RustPython/RustPython/pull/9843/commits
Checks 27 https://github.com/RustPython/RustPython/pull/9843/checks
Files changed https://github.com/RustPython/RustPython/pull/9843/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9843/files
Decouple FileIO from the os and msvcrt modules https://github.com/RustPython/RustPython/pull/9843/files#top
Show all changes 1 commit https://github.com/RustPython/RustPython/pull/9843/files
b910237 Decouple FileIO from the os and msvcrt modules youknowone Nov 14, 2026 https://github.com/RustPython/RustPython/pull/9843/commits/b9102376496114ac23c1d0170bc7d7b3b7ae784b
Clear filters https://github.com/RustPython/RustPython/pull/9843/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9843/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9843/files
file_mode.rs https://github.com/RustPython/RustPython/pull/9843/files#diff-1cf93f2588b4ccae010a4029902b19ab94fe5e50add558efd77aa3e439d824ff
io.rs https://github.com/RustPython/RustPython/pull/9843/files#diff-7def538d0e9f63d8eaa731a33e50a4a2152a1a98226a76fe893bb508179a7206
io_unsupported.rs https://github.com/RustPython/RustPython/pull/9843/files#diff-cd75750d8896b1bbaa3f8674ef7e0849d2851ef9768de84f3fa934107c316fcf
lib.rs https://github.com/RustPython/RustPython/pull/9843/files#diff-cf9f930dd10c898b22ab83a76b40df35bd5cfeb769ba5206f26deb9936d6cd86
_io.rs https://github.com/RustPython/RustPython/pull/9843/files#diff-90825edc73ec293e0ed3b2dbed7f0a492b1f8e51c25747326089a912267bdd3e
msvcrt.rs https://github.com/RustPython/RustPython/pull/9843/files#diff-cae66e9b0f447373d639cef0a769eb7b69b7a6509d91b9061ce55f867f005945
os.rs https://github.com/RustPython/RustPython/pull/9843/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
stdlib_io.py https://github.com/RustPython/RustPython/pull/9843/files#diff-248fc2f4d52b1a0f0c8c7593e25c95655ebc98aa3b75eea97ff47f775144648c
crates/host_env/src/file_mode.rshttps://github.com/RustPython/RustPython/pull/9843/files#diff-1cf93f2588b4ccae010a4029902b19ab94fe5e50add558efd77aa3e439d824ff
View file https://github.com/youknowone/RustPython/blob/b9102376496114ac23c1d0170bc7d7b3b7ae784b/crates/host_env/src/file_mode.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9843/{{ revealButtonHref }}
crates/host_env/src/io.rshttps://github.com/RustPython/RustPython/pull/9843/files#diff-7def538d0e9f63d8eaa731a33e50a4a2152a1a98226a76fe893bb508179a7206
View file https://github.com/youknowone/RustPython/blob/b9102376496114ac23c1d0170bc7d7b3b7ae784b/crates/host_env/src/io.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9843/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9843/files#diff-7def538d0e9f63d8eaa731a33e50a4a2152a1a98226a76fe893bb508179a7206
https://github.com/RustPython/RustPython/pull/9843/files#diff-7def538d0e9f63d8eaa731a33e50a4a2152a1a98226a76fe893bb508179a7206
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9843/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9843/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.