René's URL Explorer Experiment


Title: gh-102251: Updates to test_imp Toward Fixing Some Refleaks by ericsnowcurrently · Pull Request #102254 · python/cpython · GitHub

Open Graph Title: gh-102251: Updates to test_imp Toward Fixing Some Refleaks by ericsnowcurrently · Pull Request #102254 · python/cpython

X Title: gh-102251: Updates to test_imp Toward Fixing Some Refleaks by ericsnowcurrently · Pull Request #102254 · python/cpython

Description: This includes some cleanup, some tweaks to the existing tests, and a bunch of new test cases. It is all related to fixing the refleaks introduced by 096d009. I haven't been able to find the leak yet, but these changes are a consequence of that effort. The only change here that might have impact outside the tests in question is in imp.py, where I update imp.load_dynamic() to use spec_from_file_location() instead of creating a ModuleSpec directly. (See commit 0c65700 below.) Also note that I've updated the tests to only skip if we're checking for refleaks (regrtest's --huntrleaks), whereas in gh-101969 I had skipped the tests entirely. The tests will be useful for some upcoming work and I'd rather the refleaks not hold that up. (It isn't clear how quickly we'll be able to fix the leaking code, though it will certainly be done in the short term.) Issue: gh-102251

Open Graph Description: This includes some cleanup, some tweaks to the existing tests, and a bunch of new test cases. It is all related to fixing the refleaks introduced by 096d009. I haven't been able to find the l...

X Description: This includes some cleanup, some tweaks to the existing tests, and a bunch of new test cases. It is all related to fixing the refleaks introduced by 096d009. I haven't been able to find t...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b9833578-2bda-ded6-fc37-0d7f1a84d247
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD88E:C198F:AD60EB:E9A8A2:6969E76B
html-safe-nonce90326f7a7b539dfa8a1e41ce0193f2b5bd87c6523f4c1074105cc19e4802d36e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODhFOkMxOThGOkFENjBFQjpFOUE4QTI6Njk2OUU3NkIiLCJ2aXNpdG9yX2lkIjoiNDEyMTgyMDIwNTI0MDkzNjMwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaced94df4ae89579b2c4b05113831c53ee9a0d06390f01d1de2abfe1353dc50baf
hovercard-subject-tagpull_request:1254284223
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/102254/files
twitter:imagehttps://avatars.githubusercontent.com/u/1152074?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1152074?s=400&v=4
og:image:altThis includes some cleanup, some tweaks to the existing tests, and a bunch of new test cases. It is all related to fixing the refleaks introduced by 096d009. I haven't been able to find the l...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasebdde15ad1b403e23b08bbd89b53fbe6bdf688cad
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/102254/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F102254%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F102254%2Ffiles
Sign up https://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/102254/files
Reloadhttps://github.com/python/cpython/pull/102254/files
Reloadhttps://github.com/python/cpython/pull/102254/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/102254/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/102254/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
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
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
python:mainhttps://github.com/python/cpython/tree/main
ericsnowcurrently:fix-ext-module-refleakshttps://github.com/ericsnowcurrently/cpython/tree/fix-ext-module-refleaks
Conversation 2 https://github.com/python/cpython/pull/102254
Commits 17 https://github.com/python/cpython/pull/102254/commits
Checks 0 https://github.com/python/cpython/pull/102254/checks
Files changed https://github.com/python/cpython/pull/102254/files
Please reload this pagehttps://github.com/python/cpython/pull/102254/files
gh-102251: Updates to test_imp Toward Fixing Some Refleaks https://github.com/python/cpython/pull/102254/files#top
Show all changes 17 commits https://github.com/python/cpython/pull/102254/files
2be855c Stop skipping the tests. ericsnowcurrently Feb 17, 2023 https://github.com/python/cpython/pull/102254/commits/2be855c8358e3f382c2fa18ac85263449a7c1ef7
9bbedda _modules_by_index_clear() -> _modules_by_index_clear_one(). ericsnowcurrently Feb 17, 2023 https://github.com/python/cpython/pull/102254/commits/9bbeddadba9071737cf3b3fec988e0e25c58911a
83f42d6 Add an explanation of what happens when extensions are loaded. ericsnowcurrently Feb 17, 2023 https://github.com/python/cpython/pull/102254/commits/83f42d62307d66cf97eb24806f5e0f376a855c32
828a734 Add _forget_extension(). ericsnowcurrently Feb 17, 2023 https://github.com/python/cpython/pull/102254/commits/828a734364ccfe94281f1c960396cd79f417cfa9
e9096cd Clean up test_singlephase_multiple_interpreters. ericsnowcurrently Feb 17, 2023 https://github.com/python/cpython/pull/102254/commits/e9096cd7839395a5dedcbe63c9ecc5ad9a211198
c993f97 Add another test case. ericsnowcurrently Feb 17, 2023 https://github.com/python/cpython/pull/102254/commits/c993f970782a823519e74e554087eba1f720ab4f
cc5c771 Expand test_singlephase_multiple_interpreters. ericsnowcurrently Feb 18, 2023 https://github.com/python/cpython/pull/102254/commits/cc5c771a441ac2c0b7df22e9d7a0afa768087b6f
08741b8 Clean up the tests. ericsnowcurrently Feb 22, 2023 https://github.com/python/cpython/pull/102254/commits/08741b85c74921a4d4ee2c296da704a80f18f62c
31716e9 Clean up clear_singlephase_extension(). ericsnowcurrently Feb 22, 2023 https://github.com/python/cpython/pull/102254/commits/31716e917aa65294ac6cf12b5eb844ea483f3e8c
2c3dd42 Add a check. ericsnowcurrently Feb 22, 2023 https://github.com/python/cpython/pull/102254/commits/2c3dd42754e719975c59160d1725ff4bda928f9f
a353e7e Fix a typo. ericsnowcurrently Feb 22, 2023 https://github.com/python/cpython/pull/102254/commits/a353e7e9640c38e7a11e68749e38095b1ba3fa11
c6a39e3 script -> snapshot_script. ericsnowcurrently Feb 22, 2023 https://github.com/python/cpython/pull/102254/commits/c6a39e38d423bf7549d96f382fc776be849adffe
0c65700 Use spec_from_file_location() in imp.load_dynamic(). ericsnowcurrently Feb 22, 2023 https://github.com/python/cpython/pull/102254/commits/0c65700909bf91843938c2cb9a6add0caa891b65
993484e Update single-phase-init tests. ericsnowcurrently Feb 23, 2023 https://github.com/python/cpython/pull/102254/commits/993484e9ca769d7308e515020e923ddd0467f645
fc94060 Do the initial cleanup in setUpClass(). ericsnowcurrently Feb 24, 2023 https://github.com/python/cpython/pull/102254/commits/fc940603fc0b6cc6b0ccf05b4740f971b2df7f01
3e2a1dd Move the requires_load_dynamic decorator to the class. ericsnowcurrently Feb 25, 2023 https://github.com/python/cpython/pull/102254/commits/3e2a1ddb1f5dc9022c4e1b8dc9f5976d56c7d431
f0ce607 For now, skip the tests during refleak detection. ericsnowcurrently Feb 25, 2023 https://github.com/python/cpython/pull/102254/commits/f0ce6077b4441de1b54cc951f86eec64f45ebda1
Clear filters https://github.com/python/cpython/pull/102254/files
Please reload this pagehttps://github.com/python/cpython/pull/102254/files
Please reload this pagehttps://github.com/python/cpython/pull/102254/files
imp.py https://github.com/python/cpython/pull/102254/files#diff-5b7d05748b6c9c75126f97ecd81a3eb3260d42c1cfa54c0d8a9e4f5a2133e7f0
test_imp.py https://github.com/python/cpython/pull/102254/files#diff-9cc86d54c09f71fd861c830da33b68edd68a35a0305e87ebdf9e0fd7ee6bbfe4
_testsinglephase.c https://github.com/python/cpython/pull/102254/files#diff-3fbe563401944538a01a71448ef93250ea97fd91892c0656b6ebc0c72f5b96c8
import.c https://github.com/python/cpython/pull/102254/files#diff-28cfc3e2868980a79d93d2ebdc8747dcb9231f3dd7f2caef96e74107d1ea3bf3
Lib/imp.pyhttps://github.com/python/cpython/pull/102254/files#diff-5b7d05748b6c9c75126f97ecd81a3eb3260d42c1cfa54c0d8a9e4f5a2133e7f0
View file https://github.com/ericsnowcurrently/cpython/blob/f0ce6077b4441de1b54cc951f86eec64f45ebda1/Lib/imp.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/102254/{{ revealButtonHref }}
https://github.com/python/cpython/pull/102254/files#diff-5b7d05748b6c9c75126f97ecd81a3eb3260d42c1cfa54c0d8a9e4f5a2133e7f0
https://github.com/python/cpython/pull/102254/files#diff-5b7d05748b6c9c75126f97ecd81a3eb3260d42c1cfa54c0d8a9e4f5a2133e7f0
Please reload this pagehttps://github.com/python/cpython/pull/102254/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.