René's URL Explorer Experiment


Title: Share builtin standard-stream callback controls by youknowdot · Pull Request #9720 · RustPython/RustPython · GitHub

Open Graph Title: Share builtin standard-stream callback controls by youknowdot · Pull Request #9720 · RustPython/RustPython

X Title: Share builtin standard-stream callback controls by youknowdot · Pull Request #9720 · RustPython/RustPython

Description: Summary Group CPython 3.15 print/input callback controls in 167 changed lines across two production Rust files. Retain the existing derived argument binders while keeping print options as raw owners. Reject unknown keywords before flush truth conversion, resolve stdout afterward, and validate separator/end only after the stdout=None short-circuit. Borrow printed objects through every write and final flush. Preserve separator/end str-subclass conversion and contextual validation errors. Share a PyFile_WriteObject-style helper between print pieces and noninteractive input prompts. Resolve write before stringification, retain the selected callable through conversion, then release converted text, callable and write result in order. Accept arbitrary input prompts. Select and retain stdin/stdout/stderr directly from the sys dictionary, reject missing/None streams, and emit the input audit event before stream callbacks. Distinguish ignored fileno call failures from propagated integer conversion failures. Use platform C-long width, and check stdin's actual terminal status before invoking stdout.fileno. Preserve input flush-error handling, newline/EOF behavior and the existing rustyline/PTY safeguards. Convert interactive prompts once and emit the result audit event after rustyline success. Improve non-string readline diagnostics through the existing qualified-type helper. Validation Reference: CPython d220409a13b77de7a6c30abe16ea90db01528edc, Python/bltinmodule.c, its generated clinic binder, Objects/fileobject.c and Python/sysmodule.c. The pinned CPython oracle passed 47 probes and 10 explicit assertions. Independent review reran it and added seven assertions across three callback/finalizer probes. These are reference/source checks, not execution of RustPython. Independent exact-source review passed, including the final borrowed-option cleanup. Final threaded cargo check passed in 1m06s and all-targets Clippy in 2m21s, with all 12 unchanged baseline diagnostics matching exactly. No warnings were suppressed. Normal commit hooks, rustfmt and git diff --check passed. No tests, Lib files, assertions, expected failures or workflows were changed. Native RustPython execution remains unrun because the required execution guard has not been verified. Full workspace/C-API suites, native differential tests and separate platform/feature graphs remain unrun; hosted CI is pending. Scope and integration The shared file writer performs one lookup per emitted piece, not a cached lookup for the whole print call. Selected streams and raw input/print owners remain alive across callbacks. Caller-wide argument and outer stream teardown beyond the retained lifetimes are not claimed fixed. Existing extremely long separator/end type-name diagnostics are not truncated to CPython's 200-byte limit. Full CPython interactive readline, terminal encoding and fallback parity remain outside scope. The existing rustyline/PTY guard is retained, and no terminal runtime validation was performed. The independent vars exception-masking issue is not included. Existing #9690 shutdown/unraisable handling, #9699 iterator controls and #9718 min/max streaming do not duplicate these behaviors. No general sys stream helper or shutdown behavior is changed. The shared readline diagnostic affects its existing callers without changing successful or EOF behavior. AI-assisted contribution by OpenAI Codex; assistance is disclosed in the commit trailer.

Open Graph Description: Summary Group CPython 3.15 print/input callback controls in 167 changed lines across two production Rust files. Retain the existing derived argument binders while keeping print options as raw owne...

X Description: Summary Group CPython 3.15 print/input callback controls in 167 changed lines across two production Rust files. Retain the existing derived argument binders while keeping print options as raw owne...

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

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:c16fbc54-a142-b2f9-2b73-06a12e5f664a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC2AA:269AD9:329CF5C:4394357:6B01F39B
html-safe-noncedd8ceb43579389002688eb4e487ca9e116827d2c9f23ddc5b111b323b8dad774
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkFBOjI2OUFEOTozMjlDRjVDOjQzOTQzNTc6NkIwMUYzOUIiLCJ2aXNpdG9yX2lkIjoiODU0NTAyODg0NjY5OTgwMzU0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca679c3657e7c1356808f735ae61d2272f0a2216dce575fd092fe2980f99b2de9
hovercard-subject-tagpull_request:5161424054
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/9720/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 CPython 3.15 print/input callback controls in 167 changed lines across two production Rust files. Retain the existing derived argument binders while keeping print options as raw owne...
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/9720/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9720%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%2F9720%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/9720/files
Reloadhttps://github.com/RustPython/RustPython/pull/9720/files
Reloadhttps://github.com/RustPython/RustPython/pull/9720/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/builtin-stdio-controls-20261104https://github.com/youknowdot/RustPython/tree/fix/builtin-stdio-controls-20261104
Conversation 4 https://github.com/RustPython/RustPython/pull/9720
Commits 2 https://github.com/RustPython/RustPython/pull/9720/commits
Checks 27 https://github.com/RustPython/RustPython/pull/9720/checks
Files changed https://github.com/RustPython/RustPython/pull/9720/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9720/files
Share builtin standard-stream callback controls https://github.com/RustPython/RustPython/pull/9720/files#top
Show all changes 2 commits https://github.com/RustPython/RustPython/pull/9720/files
be5f3f0 Share builtin standard-stream callback controls youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9720/commits/be5f3f0e218ef43abdbffb4dcb46c4b6ea3a14be
2b4acc2 Borrow retained print separators through stream callbacks youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9720/commits/2b4acc29776683dbb3af3f7ee9d697346a45b26c
Clear filters https://github.com/RustPython/RustPython/pull/9720/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9720/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9720/files
py_io.rs https://github.com/RustPython/RustPython/pull/9720/files#diff-17ec801126ce7b92c344253956eabebc14e1f36a302393a635734fbedef80b42
builtins.rs https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
crates/vm/src/py_io.rshttps://github.com/RustPython/RustPython/pull/9720/files#diff-17ec801126ce7b92c344253956eabebc14e1f36a302393a635734fbedef80b42
View file https://github.com/youknowdot/RustPython/blob/2b4acc29776683dbb3af3f7ee9d697346a45b26c/crates/vm/src/py_io.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9720/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9720/files#diff-17ec801126ce7b92c344253956eabebc14e1f36a302393a635734fbedef80b42
https://github.com/RustPython/RustPython/pull/9720/files#diff-17ec801126ce7b92c344253956eabebc14e1f36a302393a635734fbedef80b42
https://github.com/RustPython/RustPython/pull/9720/files#diff-17ec801126ce7b92c344253956eabebc14e1f36a302393a635734fbedef80b42
https://github.com/RustPython/RustPython/pull/9720/files#diff-17ec801126ce7b92c344253956eabebc14e1f36a302393a635734fbedef80b42
https://github.com/RustPython/RustPython/pull/9720/files#diff-17ec801126ce7b92c344253956eabebc14e1f36a302393a635734fbedef80b42
crates/vm/src/stdlib/builtins.rshttps://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
View file https://github.com/youknowdot/RustPython/blob/2b4acc29776683dbb3af3f7ee9d697346a45b26c/crates/vm/src/stdlib/builtins.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9720/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
youknowonehttps://github.com/youknowone
Nov 6, 2026https://github.com/RustPython/RustPython/pull/9720/files#r4492628302
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#9563https://github.com/RustPython/RustPython/pull/9563
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9720/files
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9720/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9720/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.