René's URL Explorer Experiment


Title: Align debugger hook dispatch and callback lifetimes by youknowdot · Pull Request #9722 · RustPython/RustPython · GitHub

Open Graph Title: Align debugger hook dispatch and callback lifetimes by youknowdot · Pull Request #9722 · RustPython/RustPython

X Title: Align debugger hook dispatch and callback lifetimes by youknowdot · Pull Request #9722 · RustPython/RustPython

Description: Summary Align breakpoint and sys.breakpointhook callback controls in 122 changed lines across two production Rust files. Select sys.breakpointhook directly from the sys dictionary and audit the selected callable before invoking it. Preserve the selection if an audit hook replaces it, and distinguish missing from a present None. Retain raw positional and keyword arguments until after the selected/resolved hook is released, including call failures. Use FuncArgs directly rather than reconstructing it through a second argument converter. Respect ignore_environment before reading PYTHONBREAKPOINT, preserve disabled/default handling, and reject leading-dot names without attempting import. Reuse import_from with an empty list, discard the importer result and retrieve the exact registered module rather than using a top-level package or arbitrary importer return. Retain the from-list through module lookup. Warn only for ImportError during import and AttributeError during hook lookup. Propagate other exceptions and warning failures. Release the imported module before calling the resolved hook. Reference: CPython d220409a13b77de7a6c30abe16ea90db01528edc, builtin breakpoint and sys.breakpointhook. Validation Independent exact-patch source review passed. The original bounded reflection/debugger CPython oracle passed 64 cases and 36 assertions; independent additional checks passed 13 cases and 25 assertions covering error subclasses, warning-as-error, importer result disposal, exact module lookup and retained from-list cleanup. Stub hooks were used throughout; no debugger was launched. These establish reference behavior and source reasoning, not RustPython runtime results. Final threaded host-env/VM/stdlib cargo check passed in 1m07s and all-targets Clippy in 4m09s. All 12 baseline diagnostics match unchanged, without suppression. Normal commit hooks passed. Compiler-reported configuration, dictionary-key and dynamic-name API mismatches were corrected and independently re-reviewed before these final checks. Limits and integration Native RustPython execution was not performed because the required execution guard has not been verified. Full workspace/C-API suites and separate platform/feature graphs remain unrun; hosted CI is pending. No tests, Lib files, assertions, expected-failure markers or workflows were changed. This is not full PyImport_Import parity: current VM import helpers still differ in globals/locals and builtins selection, and interpreter-internal versus reassigned sys.modules behavior remains separate. Environment encoding and universal caller-tail argument destruction order are not claimed. Raw owners are retained through internal hook cleanup. Relevant #9720 print/input, #9690 shutdown and #9612 tracing patches were inspected and do not overlap these modified hunks. This branch is based directly on main dc84268 and does not include those unrelated changes. AI-assisted contribution by OpenAI Codex; assistance is disclosed in commit trailers. Summary by CodeRabbit Bug Fixes Module imports through the Python C API now return the module associated with the requested name. Breakpoint handling follows PYTHONBREAKPOINT when environment settings are enabled, uses the debugger by default otherwise, and can be disabled with PYTHONBREAKPOINT=0. Invalid or unavailable breakpoint hooks produce warnings; other errors are preserved. Breakpoint hooks receive the original arguments and are audited before being called.

Open Graph Description: Summary Align breakpoint and sys.breakpointhook callback controls in 122 changed lines across two production Rust files. Select sys.breakpointhook directly from the sys dictionary and audit the se...

X Description: Summary Align breakpoint and sys.breakpointhook callback controls in 122 changed lines across two production Rust files. Select sys.breakpointhook directly from the sys dictionary and audit the se...

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

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:6e793254-1589-99a0-b36e-489a8b3ecdd1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9DA8:2E7EBB:3C1F833:4C1EBCB:6B01FA0B
html-safe-nonce2e78426869f71767cea912fa7b3c6856d3ceef9d2a42c7e8bdca8cfa7c15d90e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REE4OjJFN0VCQjozQzFGODMzOjRDMUVCQ0I6NkIwMUZBMEIiLCJ2aXNpdG9yX2lkIjoiNjg2Mzk2ODE1ODczNTI2ODM2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac53520f5b89540db70bdd696410718db50e776bf17078fe014b50896694926400
hovercard-subject-tagpull_request:5162487823
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/9722/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 Align breakpoint and sys.breakpointhook callback controls in 122 changed lines across two production Rust files. Select sys.breakpointhook directly from the sys dictionary and audit the se...
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-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9722/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9722%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%2F9722%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/9722/files
Reloadhttps://github.com/RustPython/RustPython/pull/9722/files
Reloadhttps://github.com/RustPython/RustPython/pull/9722/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/debugger-hook-controls-20261104https://github.com/youknowdot/RustPython/tree/fix/debugger-hook-controls-20261104
Conversation 10 https://github.com/RustPython/RustPython/pull/9722
Commits 10 https://github.com/RustPython/RustPython/pull/9722/commits
Checks 27 https://github.com/RustPython/RustPython/pull/9722/checks
Files changed https://github.com/RustPython/RustPython/pull/9722/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9722/files
Align debugger hook dispatch and callback lifetimes https://github.com/RustPython/RustPython/pull/9722/files#top
Show all changes 10 commits https://github.com/RustPython/RustPython/pull/9722/files
82dad85 Align debugger hook dispatch and callback lifetimes youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/82dad8548c125d1d3343b231ce4bf5fd343d4538
98edaac Use current VM configuration and dictionary key APIs youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/98edaaca62b08aab90fddc0898364bdbb91f5f77
c477dde Allocate the selected debugger attribute name youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/c477dde28f35b057658e7d6c14c2dc2e53171827
28d0c74 Share explicit import callback protocol and owner cleanup youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/28d0c74232daa6cbe834a361537de32be6b026e9
3bab1bf Use scope cleanup for debugger hook lifetimes youknowdot Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/3bab1bf5af6e42993ea2cea6da35cbb8dfb07348
1c6426a Retain debugger arguments with ordered scope owners youknowdot Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/1c6426a6d6ebc86d5499b01abb08fcafe0366af4
95e58e2 Rely on scope cleanup for redundant explicit drops codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/95e58e283141b5255713623e551020393e4bb46b
e5ce631 Use owner declaration order for import cleanup codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/e5ce631ca8cc75f640fdd11fba3a9a19068da0f9
da3b961 Return the import result directly after ordered cleanup codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/da3b961255d0e6bc58215a8bf3d9ed3636b39438
b607f65 Remove obsolete debugger rebase import codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9722/commits/b607f65dfae48e261e6897a22e1be85d36335c43
Clear filters https://github.com/RustPython/RustPython/pull/9722/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9722/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9722/files
import.rs https://github.com/RustPython/RustPython/pull/9722/files#diff-5fc5c066a08a184758c935901fbac5431e8aa176bf503676b07837e2b07988af
import.rs https://github.com/RustPython/RustPython/pull/9722/files#diff-fdf183809931dc08d13609a0577f60effd521a60f8659606569d495720eb97d3
builtins.rs https://github.com/RustPython/RustPython/pull/9722/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
sys.rs https://github.com/RustPython/RustPython/pull/9722/files#diff-e7f7c10b81f88d7af77af76257284e18e72ed9da63ff63675a9e9cb31c8d262d
crates/capi/src/import.rshttps://github.com/RustPython/RustPython/pull/9722/files#diff-5fc5c066a08a184758c935901fbac5431e8aa176bf503676b07837e2b07988af
View file https://github.com/youknowdot/RustPython/blob/b607f65dfae48e261e6897a22e1be85d36335c43/crates/capi/src/import.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9722/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9722/files#diff-5fc5c066a08a184758c935901fbac5431e8aa176bf503676b07837e2b07988af
https://github.com/RustPython/RustPython/pull/9722/files#diff-5fc5c066a08a184758c935901fbac5431e8aa176bf503676b07837e2b07988af
crates/vm/src/import.rshttps://github.com/RustPython/RustPython/pull/9722/files#diff-fdf183809931dc08d13609a0577f60effd521a60f8659606569d495720eb97d3
View file https://github.com/youknowdot/RustPython/blob/b607f65dfae48e261e6897a22e1be85d36335c43/crates/vm/src/import.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9722/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9722/files#diff-fdf183809931dc08d13609a0577f60effd521a60f8659606569d495720eb97d3
coderabbitaihttps://github.com/apps/coderabbitai
Nov 7, 2026https://github.com/RustPython/RustPython/pull/9722/files#r4501770741
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9722/files
coderabbitaihttps://github.com/apps/coderabbitai
Nov 7, 2026https://github.com/RustPython/RustPython/pull/9722/files#r4503642250
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9722/files
https://github.com/RustPython/RustPython/pull/9722/files#diff-fdf183809931dc08d13609a0577f60effd521a60f8659606569d495720eb97d3
crates/vm/src/stdlib/builtins.rshttps://github.com/RustPython/RustPython/pull/9722/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
View file https://github.com/youknowdot/RustPython/blob/b607f65dfae48e261e6897a22e1be85d36335c43/crates/vm/src/stdlib/builtins.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9722/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9722/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9722/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
https://github.com/RustPython/RustPython/pull/9722/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
youknowonehttps://github.com/youknowone
Nov 7, 2026https://github.com/RustPython/RustPython/pull/9722/files#r4501776846
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9722/files
https://github.com/RustPython/RustPython/pull/9722/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
crates/vm/src/stdlib/sys.rshttps://github.com/RustPython/RustPython/pull/9722/files#diff-e7f7c10b81f88d7af77af76257284e18e72ed9da63ff63675a9e9cb31c8d262d
View file https://github.com/youknowdot/RustPython/blob/b607f65dfae48e261e6897a22e1be85d36335c43/crates/vm/src/stdlib/sys.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9722/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9722/files#diff-e7f7c10b81f88d7af77af76257284e18e72ed9da63ff63675a9e9cb31c8d262d
https://github.com/RustPython/RustPython/pull/9722/files#diff-e7f7c10b81f88d7af77af76257284e18e72ed9da63ff63675a9e9cb31c8d262d
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9722/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.