René's URL Explorer Experiment


Title: gh-37883: Safely skip test_resource file size tests when limits are strict by Shrey-N · Pull Request #145579 · python/cpython · GitHub

Open Graph Title: gh-37883: Safely skip test_resource file size tests when limits are strict by Shrey-N · Pull Request #145579 · python/cpython

X Title: gh-37883: Safely skip test_resource file size tests when limits are strict by Shrey-N · Pull Request #145579 · python/cpython

Description: This fixes the Standing issue #37883 where test_resource would fail on systems with file size limitations Previous attempts (like #140872) tried to introduce massive refactoring and helper classes. Based on reviewer feedback I read there, I have tried a minimal fix It checks if the system's hard limit is large enough, and if the OS actually allows the limit to be modified. If not, it uses self.skipTest with an informative message rather than failing with an unhandled OSError or ValueError. It replaces the fragile dual try...finally resource restoration blocks with self.addCleanup(), guaranteeing that limits are reset even during a test assertion failure. Fixes #37883 Issue: gh-37883

Open Graph Description: This fixes the Standing issue #37883 where test_resource would fail on systems with file size limitations Previous attempts (like #140872) tried to introduce massive refactoring and helper classes....

X Description: This fixes the Standing issue #37883 where test_resource would fail on systems with file size limitations Previous attempts (like #140872) tried to introduce massive refactoring and helper classes....

Opengraph URL: https://github.com/python/cpython/pull/145579

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:f72e7fb4-685f-48da-db51-a21b63b15f2d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD2CE:EA06E:44D66C0:5753FC9:6B0217F6
html-safe-nonce8bbf3e98e0de2bba6548f1d387e2fb3390863ec58e6393ea95278a452479250b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkNFOkVBMDZFOjQ0RDY2QzA6NTc1M0ZDOTo2QjAyMTdGNiIsInZpc2l0b3JfaWQiOiI2NTg0OTUwNzM2NTQxNTg3NDQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb84de1707ecdb6184e351e9e3755466c1434eb4c2e8d4c900eb27997f4d5aad9
hovercard-subject-tagpull_request:3362718017
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/python/cpython/pull/145579/files
twitter:imagehttps://avatars.githubusercontent.com/u/221686259?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/221686259?s=400&v=4
og:image:altThis fixes the Standing issue #37883 where test_resource would fail on systems with file size limitations Previous attempts (like #140872) tried to introduce massive refactoring and helper classes....
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
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/python/cpython/pull/145579/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F145579%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%2Fpython%2Fcpython%2Fpull%2F145579%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=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/145579/files
Reloadhttps://github.com/python/cpython/pull/145579/files
Reloadhttps://github.com/python/cpython/pull/145579/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
encukouhttps://github.com/encukou
python:mainhttps://github.com/python/cpython/tree/main
Shrey-N:fixy-branchhttps://github.com/Shrey-N/cpython-for-fix/tree/fixy-branch
Conversation 21 https://github.com/python/cpython/pull/145579
Commits 20 https://github.com/python/cpython/pull/145579/commits
Checks 54 https://github.com/python/cpython/pull/145579/checks
Files changed https://github.com/python/cpython/pull/145579/files
Please reload this pagehttps://github.com/python/cpython/pull/145579/files
gh-37883: Safely skip test_resource file size tests when limits are strict https://github.com/python/cpython/pull/145579/files#top
Show all changes 20 commits https://github.com/python/cpython/pull/145579/files
3cae226 gh-37883: Safely skip test_resource file size tests when limits are s… Shrey-N Mar 6, 2026 https://github.com/python/cpython/pull/145579/commits/3cae2262a0ddac67d547c69d209ebaf7174bf0b0
f217fb1 📜🤖 Added by blurb_it. blurb-it[bot] Mar 6, 2026 https://github.com/python/cpython/pull/145579/commits/f217fb1a9dcbeec2b51e5187b9207d6fb94fd2a7
ef28dbc Update News Entry Shrey-N Mar 6, 2026 https://github.com/python/cpython/pull/145579/commits/ef28dbcb738a0a0df4ce3ad487a9385802f59cd8
f74f58e Update 2026-03-06-09-43-49.gh-issue-37883.I-3oZq.rst Shrey-N Mar 8, 2026 https://github.com/python/cpython/pull/145579/commits/f74f58e493a13375bdd4d836704dadba0c02aa5e
d21ceb8 Refactor test_resource.py on the advice Shrey-N Mar 10, 2026 https://github.com/python/cpython/pull/145579/commits/d21ceb8a8185410de5b111fbaff026455e6ed129
65b0b88 fix lint error Shrey-N Mar 10, 2026 https://github.com/python/cpython/pull/145579/commits/65b0b8800b28f64d25c798c60b94d64f383863c6
1600c31 Update test_resource.py Shrey-N Mar 10, 2026 https://github.com/python/cpython/pull/145579/commits/1600c310ea0fc8372a7cde1a47a9b75f4c232892
7fb6b72 Fix formatting in test_resource.py Shrey-N Mar 10, 2026 https://github.com/python/cpython/pull/145579/commits/7fb6b7214b279dd5c54033c4a4b486df9fe755e4
29255c2 Update test_resource.py Shrey-N Mar 11, 2026 https://github.com/python/cpython/pull/145579/commits/29255c2c8cc3fd5f4ef4f380f48febfb3a26ce7f
3dc4653 Update test_resource.py Shrey-N Mar 15, 2026 https://github.com/python/cpython/pull/145579/commits/3dc4653804b6ff098cb98e2492dcffb1d075b413
de3c792 Fix indentation in test_resource.py Shrey-N Mar 15, 2026 https://github.com/python/cpython/pull/145579/commits/de3c7926a43287812e5bb25932466d2aad758c2d
61822dd Remove unused 'time' import from test_resource.py Shrey-N Mar 15, 2026 https://github.com/python/cpython/pull/145579/commits/61822ddffae0d98287543c02a626b70dead6f98f
3b02180 Delete Misc/NEWS.d/next/Tests/2026-03-06-09-43-49.gh-issue-37883.I-3o… Shrey-N Mar 15, 2026 https://github.com/python/cpython/pull/145579/commits/3b021808ae8660898be9a1ea95dc595a0a0b35a9
befd67a Update test_resource.py Shrey-N Mar 15, 2026 https://github.com/python/cpython/pull/145579/commits/befd67afbe2d92aa5e283265683d64ae6a4a82b4
16acaa4 Update test_resource.py Shrey-N Mar 15, 2026 https://github.com/python/cpython/pull/145579/commits/16acaa40307affa60ae4d5e2063f5de90388a2a2
4f7a349 Refactor resource limit tests for clarity and cleanup Shrey-N Mar 29, 2026 https://github.com/python/cpython/pull/145579/commits/4f7a349d4d1df111984aa473443212f349f87750
4564e1f Merge branch 'main' into fixy-branch encukou Apr 1, 2026 https://github.com/python/cpython/pull/145579/commits/4564e1fe4519f6076123ca1f983517dc0125929a
1808a8a Update based on suggestion Shrey-N Apr 7, 2026 https://github.com/python/cpython/pull/145579/commits/1808a8a38f75d4f4aeb662824c24bd7614784872
6faed32 Update Lib/test/test_resource.py based on suggestion Shrey-N Apr 7, 2026 https://github.com/python/cpython/pull/145579/commits/6faed32693d4a11521c9383bb23d6ace70f965b6
58fb908 Update Lib/test/test_resource.py Shrey-N Apr 7, 2026 https://github.com/python/cpython/pull/145579/commits/58fb908d48c4cc7c6bd03417a884a987053c29f8
Clear filters https://github.com/python/cpython/pull/145579/files
Please reload this pagehttps://github.com/python/cpython/pull/145579/files
Please reload this pagehttps://github.com/python/cpython/pull/145579/files
Lib/test/test_resource.pyhttps://github.com/python/cpython/pull/145579/files#diff-c2111bdd4066b3633383ccb47c447ca3fc3d25f6dfeaa5612658338c00b28bba
View file https://github.com/Shrey-N/cpython-for-fix/blob/58fb908d48c4cc7c6bd03417a884a987053c29f8/Lib/test/test_resource.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/145579/{{ revealButtonHref }}
https://github.com/python/cpython/pull/145579/files#diff-c2111bdd4066b3633383ccb47c447ca3fc3d25f6dfeaa5612658338c00b28bba
https://github.com/python/cpython/pull/145579/files#diff-c2111bdd4066b3633383ccb47c447ca3fc3d25f6dfeaa5612658338c00b28bba
https://github.com/python/cpython/pull/145579/files#diff-c2111bdd4066b3633383ccb47c447ca3fc3d25f6dfeaa5612658338c00b28bba
https://github.com/python/cpython/pull/145579/files#diff-c2111bdd4066b3633383ccb47c447ca3fc3d25f6dfeaa5612658338c00b28bba
Please reload this pagehttps://github.com/python/cpython/pull/145579/files
Please reload this pagehttps://github.com/python/cpython/pull/145579/files
https://github.com/python/cpython/pull/145579/files#diff-c2111bdd4066b3633383ccb47c447ca3fc3d25f6dfeaa5612658338c00b28bba
Please reload this pagehttps://github.com/python/cpython/pull/145579/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.