René's URL Explorer Experiment


Title: Fix closerange empty ranges before unsigned conversion by youknowdot · Pull Request #9031 · RustPython/RustPython · GitHub

Open Graph Title: Fix closerange empty ranges before unsigned conversion by youknowdot · Pull Request #9031 · RustPython/RustPython

X Title: Fix closerange empty ranges before unsigned conversion by youknowdot · Pull Request #9031 · RustPython/RustPython

Description: Summary Fix empty os.closerange() ranges before converting the exclusive upper bound to an inclusive unsigned bound. After clamping the lower bound, equal bounds must return without calling close_range(). Otherwise an empty range with a zero upper bound can convert -1 to UINT_MAX and close every descriptor; other equal bounds must also be no-ops. Refresh the existing PR by merging main df0d1b74c04408365f66666a03054d673dbccee7 append-only. The current-main diff contains only the Rust fix and its existing subprocess regression; the previously shared PyO3 benchmark-import correction is already on main and no longer appears in this PR's diff. No new tests, skips, or Lib changes are introduced by this refresh. Regression coverage and reference limitation The existing stdlib_os.py snippet runs the closerange regression in a child process. All RustPython no-op cases remain active: (0, 0), (-1, 0), positive equal bounds, positive reversed bounds, and (-2, -1). The single-descriptor case verifies adjacent descriptors remain open. The exact CPython 3.15.0 Linux reference artifact reproduced python/cpython#159182; upstream fix #159183 remains open at this refresh. The existing guard excludes only the three documented zero/negative-upper-bound cases on CPython 3.15.0 final, Linux, with HAVE_CLOSE_RANGE. Other reference cases and all RustPython cases remain active. This refresh does not alter that guard or any assertion. Validation The resulting closerange function and complete existing stdlib_os.py snippet are byte-identical to previously tested PR head 5bc1814470459db99366b67e855c71d58d2f414c. Existing canonical Lib/test/test_os closerange tests do not cover the empty/equal-bound regression; no duplicate snippet coverage was added during this refresh. Fresh cargo check and strict cargo clippy -- -D warnings for rustpython-host_env --lib passed against the current-main composition (locked, offline, Linux target, fresh target directory). Input closure verification passed before and after both checks. The first offline check stopped before compilation because the shared cache lacked registry xml; a separate cache populated with normal locked Cargo fetch resolved it without changing dependencies or Cargo.lock. Normal commit hooks passed for merge commit 335a575a7e202501f683e1d07e945ed7fa44542b: merge-conflict and rustfmt passed; Ruff, redundant-test-patches and Prettier selected no files. Only cspell was excluded with the maintainer-authorized one-commit exception because its dependency setup was blocked. This is not a cspell pass. The earlier head's hosted CI succeeded. This is historical evidence, not a claim that the current-main composition has passed CI or fresh interpreter runtime tests. No full interpreter build, closerange execution, full workspace/C-API suite or unrelated GC-stress test was run locally for this refresh. Hosted correctness CI completed successfully for exact merge commit 335a575a7e202501f683e1d07e945ed7fa44542b: all 24 jobs passed, including Linux/macOS/Windows snippets and CPython tests and Rust tests. The Lib Dependencies Check workflow does not apply because this PR changes no Lib/** files. AI assistance: dot inspected, prepared and reviewed the current-main refresh under maintainer direction. The runtime does not expose its exact model version.

Open Graph Description: Summary Fix empty os.closerange() ranges before converting the exclusive upper bound to an inclusive unsigned bound. After clamping the lower bound, equal bounds must return without calling close_r...

X Description: Summary Fix empty os.closerange() ranges before converting the exclusive upper bound to an inclusive unsigned bound. After clamping the lower bound, equal bounds must return without calling close_r...

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

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:bec43392-f1ed-d6fa-bce8-44b3b229ecd9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBC86:16AB79:3A28C90:49EC8D9:6B01FE1D
html-safe-nonce36e0452c45a833bfea0a68f8c7e8d9baacedfe9979a538f778ff0c884318e24b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzg2OjE2QUI3OTozQTI4QzkwOjQ5RUM4RDk6NkIwMUZFMUQiLCJ2aXNpdG9yX2lkIjoiMjI4Nzg1MDY3MDQyOTMwMjA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac316b0a3b2f1e39a0b2d709cf7f271bbf6834a733b3b2992aa3d2f265fb4e3cb3
hovercard-subject-tagpull_request:4807594141
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/9031/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 Fix empty os.closerange() ranges before converting the exclusive upper bound to an inclusive unsigned bound. After clamping the lower bound, equal bounds must return without calling close_r...
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/9031/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9031%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%2F9031%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/9031/files
Reloadhttps://github.com/RustPython/RustPython/pull/9031/files
Reloadhttps://github.com/RustPython/RustPython/pull/9031/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
youknowdothttps://github.com/youknowdot
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowdot:fix/closerange-empty-rangehttps://github.com/youknowdot/RustPython/tree/fix/closerange-empty-range
Conversation 2 https://github.com/RustPython/RustPython/pull/9031
Commits 4 https://github.com/RustPython/RustPython/pull/9031/commits
Checks 27 https://github.com/RustPython/RustPython/pull/9031/checks
Files changed https://github.com/RustPython/RustPython/pull/9031/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9031/files
Fix closerange empty ranges before unsigned conversion https://github.com/RustPython/RustPython/pull/9031/files#top
Show all changes 4 commits https://github.com/RustPython/RustPython/pull/9031/files
c1fc7e8 Fix closerange empty ranges before unsigned conversion youknowdot Oct 16, 2026 https://github.com/RustPython/RustPython/pull/9031/commits/c1fc7e84b4e0b207f957d384e1f317ed5c198ad8
5067bb3 Fix deprecated PyO3 code input import in benchmarks youknowdot Oct 16, 2026 https://github.com/RustPython/RustPython/pull/9031/commits/5067bb3d935d825c9bb6c2e3c8947812dafce07f
5bc1814 Scope closerange reference exclusion to affected CPython build youknowdot Oct 16, 2026 https://github.com/RustPython/RustPython/pull/9031/commits/5bc1814470459db99366b67e855c71d58d2f414c
335a575 Refresh closerange fix against current main codex Oct 27, 2026 https://github.com/RustPython/RustPython/pull/9031/commits/335a575a7e202501f683e1d07e945ed7fa44542b
Clear filters https://github.com/RustPython/RustPython/pull/9031/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9031/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9031/files
crt_fd.rs https://github.com/RustPython/RustPython/pull/9031/files#diff-ff82b67fc4d8cf44a1248a541dbf04dca2c5554aaaaf76d169327f8930f004c4
stdlib_os.py https://github.com/RustPython/RustPython/pull/9031/files#diff-4c445fa6cef3356957ef3018698f8e697672ec3e3b68eb58f431f19af2c9923a
crates/host_env/src/crt_fd.rshttps://github.com/RustPython/RustPython/pull/9031/files#diff-ff82b67fc4d8cf44a1248a541dbf04dca2c5554aaaaf76d169327f8930f004c4
View file https://github.com/RustPython/RustPython/blob/335a575a7e202501f683e1d07e945ed7fa44542b/crates/host_env/src/crt_fd.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9031/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9031/files#diff-ff82b67fc4d8cf44a1248a541dbf04dca2c5554aaaaf76d169327f8930f004c4
https://github.com/RustPython/RustPython/pull/9031/files#diff-ff82b67fc4d8cf44a1248a541dbf04dca2c5554aaaaf76d169327f8930f004c4
extra_tests/snippets/stdlib_os.pyhttps://github.com/RustPython/RustPython/pull/9031/files#diff-4c445fa6cef3356957ef3018698f8e697672ec3e3b68eb58f431f19af2c9923a
View file https://github.com/RustPython/RustPython/blob/335a575a7e202501f683e1d07e945ed7fa44542b/extra_tests/snippets/stdlib_os.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9031/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9031/files#diff-4c445fa6cef3356957ef3018698f8e697672ec3e3b68eb58f431f19af2c9923a
https://github.com/RustPython/RustPython/pull/9031/files#diff-4c445fa6cef3356957ef3018698f8e697672ec3e3b68eb58f431f19af2c9923a
https://github.com/RustPython/RustPython/pull/9031/files#diff-4c445fa6cef3356957ef3018698f8e697672ec3e3b68eb58f431f19af2c9923a
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9031/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.