René's URL Explorer Experiment


Title: `FileFinder._find_children` can loop forever on a persistently failing directory scan · Issue #155935 · python/cpython · GitHub

Open Graph Title: `FileFinder._find_children` can loop forever on a persistently failing directory scan · Issue #155935 · python/cpython

X Title: `FileFinder._find_children` can loop forever on a persistently failing directory scan · Issue #155935 · python/cpython

Description: Location: Lib/importlib/_bootstrap_external.py:1469 (inside a while True: loop, backing the new PathEntryFinder.discover() API, added 2026 via gh-139899) cpython/Lib/importlib/_bootstrap_external.py Lines 1452 to 1472 in 1ad63cc def _fin...

Open Graph Description: Location: Lib/importlib/_bootstrap_external.py:1469 (inside a while True: loop, backing the new PathEntryFinder.discover() API, added 2026 via gh-139899) cpython/Lib/importlib/_bootstrap_external.p...

X Description: Location: Lib/importlib/_bootstrap_external.py:1469 (inside a while True: loop, backing the new PathEntryFinder.discover() API, added 2026 via gh-139899) cpython/Lib/importlib/_bootstrap_external.p...

Opengraph URL: https://github.com/python/cpython/issues/155935

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`FileFinder._find_children` can loop forever on a persistently failing directory scan","articleBody":"- **Location:** `Lib/importlib/_bootstrap_external.py:1469` (inside a `while True:` loop, backing the new `PathEntryFinder.discover()` API, added 2026 via gh-139899)\n\nhttps://github.com/python/cpython/blob/1ad63ccc066a329180cfa8f4a8c4be8be47db973/Lib/importlib/_bootstrap_external.py#L1452-L1472 \n\n- **Problem:** Scans a directory via `os.scandir()`; any `OSError` from `next()` or from an entry's `is_dir()`/`is_file()` is caught and ignored **without breaking the loop**. For a *transient* single-entry failure this is reasonable (skip and continue). But if the underlying condition is *persistent* — e.g. an NFS \"stale file handle,\" a disconnected removable volume — every subsequent `next()` raises the same error forever, and the loop never terminates: no `break`, no retry limit.\n- **Reproducer (verified):** patched `os.scandir` to return an iterator whose `__next__` unconditionally raises `OSError` forever; `finder._find_children()` under a 10-second `timeout` was killed (exit 124) — confirmed genuine hang. A companion test with a single *transient* injected error correctly skipped it and returned all real entries, confirming the \"skip one bad entry\" case works — it's specifically the persistent-failure case that hangs.\n- **Suggested fix:** Add a `break` (or a bounded retry counter) in the `except OSError:` branch.\n- **Difficulty:** Small, but a real hang bug (not just silent data loss) — worth flagging prominently. New code (2026), no existing discussion found.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-155939\n* gh-162324\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/tobiaspal","@type":"Person","name":"tobiaspal"},"datePublished":"2026-08-17T06:05:53Z","url":"https://github.com/python/cpython/issues/155935"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c655e0df-a4f3-7fae-12c7-62f220b509e9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id884E:23E48:1CE408:248759:6B0202AA
html-safe-nonceebef0850c3529b046cc051088449ab0541c9b8bfee83c7dfc36554956ee87b77
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODRFOjIzRTQ4OjFDRTQwODoyNDg3NTk6NkIwMjAyQUEiLCJ2aXNpdG9yX2lkIjoiODY0NTI5NjY1NzgxNjIyNDQyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacceb4fda5f1f6196624ce98dfb11cd0fed71031979ba76bd592f16531859f4cf8
hovercard-subject-tagissue:5168814576
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/155935/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fa6d189efa6aa0de952edbdddd4acfc55d28a5724e5ee88e14575cd574c978ac/python/cpython/issues/155935
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fa6d189efa6aa0de952edbdddd4acfc55d28a5724e5ee88e14575cd574c978ac/python/cpython/issues/155935
og:image:altLocation: Lib/importlib/_bootstrap_external.py:1469 (inside a while True: loop, backing the new PathEntryFinder.discover() API, added 2026 via gh-139899) cpython/Lib/importlib/_bootstrap_external.p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametobiaspal
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
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-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/155935#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F155935
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%2Fissues%2F155935
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/155935
Reloadhttps://github.com/python/cpython/issues/155935
Reloadhttps://github.com/python/cpython/issues/155935
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
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/155935
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/155935
FileFinder._find_children can loop forever on a persistently failing directory scanhttps://github.com/python/cpython/issues/155935#top
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-importlibhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-importlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/tobiaspal
tobiaspalhttps://github.com/tobiaspal
on Aug 17, 2026https://github.com/python/cpython/issues/155935#issue-5168814576
Introduce MetaPathFinder.discover and PathEntryFinder.discover #139899https://github.com/python/cpython/issues/139899
cpython/Lib/importlib/_bootstrap_external.pyhttps://github.com/python/cpython/blob/1ad63ccc066a329180cfa8f4a8c4be8be47db973/Lib/importlib/_bootstrap_external.py#L1452-L1472
1ad63cchttps://github.com/python/cpython/commit/1ad63ccc066a329180cfa8f4a8c4be8be47db973
gh-155935: Stop FileFinder._find_children retrying a failing directory scan #155939https://github.com/python/cpython/pull/155939
[3.15] gh-155935: Stop FileFinder._find_children retrying a failing directory scan (GH-155939) #162324https://github.com/python/cpython/pull/162324
tobiaspalhttps://github.com/tobiaspal
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Aug 17, 2026https://github.com/python/cpython/issues/155935#event-29545308162
StanFromIrelandhttps://github.com/StanFromIreland
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-importlibhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-importlib%22
on Aug 17, 2026https://github.com/python/cpython/issues/155935#event-29553461055
FFY00https://github.com/FFY00
on Nov 20, 2026https://github.com/python/cpython/issues/155935#event-36772718227
gh-155935: Stop `FileFinder._find_children` retrying a failing direct…https://github.com/python/cpython/commit/4d342eb907bff64ac99825faec95f73584ebf334
gh-155935https://github.com/python/cpython/issues/155935
4d342ebhttps://github.com/python/cpython/commit/4d342eb907bff64ac99825faec95f73584ebf334
https://github.com/FFY00
FFY00https://github.com/FFY00
on Nov 20, 2026https://github.com/python/cpython/issues/155935#issuecomment-7040724144
GH-155939https://github.com/python/cpython/pull/155939
FFY00https://github.com/FFY00
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 20, 2026https://github.com/python/cpython/issues/155935#event-36772772849
FFY00https://github.com/FFY00
on Nov 20, 2026https://github.com/python/cpython/issues/155935#event-36776256672
[3.15] gh-155935: Stop `FileFinder._find_children` retrying a failing…https://github.com/python/cpython/commit/ab9e3065c829069c5bd4ce076959a0926b656de6
gh-155935https://github.com/python/cpython/issues/155935
ab9e306https://github.com/python/cpython/commit/ab9e3065c829069c5bd4ce076959a0926b656de6
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/155935
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/155935
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-importlibhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-importlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
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.