FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-159288: Avoid segfault by adding missing recursion checks when walking lazy import chains (GH-159289) by miss-islington · Pull Request #159416 · python/cpython · GitHub

Repository navigation

[3.15] gh-159288: Avoid segfault by adding missing recursion checks when walking lazy import chains (GH-159289) - #159416

Merged
Yhg1s merged 1 commit into
python:3.15from
miss-islington:backport-2588362-3.15
Oct 14, 2026
Merged

Yhg1s merged 1 commit into
python:3.15from
miss-islington:backport-2588362-3.15

Conversation

miss-islington commented Oct 14, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Add missing recursion checks when walking lazy import chains

lazy import a.b.c as d nests one placeholder per name component.
lazy_import_path() and lazy_import_replay_from() recursed over that
chain without a recursion check, so a very long dotted name could
overflow the C stack. Raise RecursionError instead, as the rest of
lazy import resolution does.
(cherry picked from commit 2588362)

Co-authored-by: Brittany Reynoso breynoso@meta.com

…en walking lazy import chains (pythonGH-159289)

Add missing recursion checks when walking lazy import chains

`lazy import a.b.c as d` nests one placeholder per name component.
lazy_import_path() and lazy_import_replay_from() recursed over that
chain without a recursion check, so a very long dotted name could
overflow the C stack. Raise RecursionError instead, as the rest of
lazy import resolution does.
(cherry picked from commit 2588362)

Co-authored-by: Brittany Reynoso <breynoso@meta.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL