You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lazy import a.b as c incorrectly binds to a.b.b #157614
The sys.modules fast path at lines 3313-3331 runs before the base-module computation at 3333-3360 and looks up name directly in d->lz_from.
In the IMPORT_FROM chain generated for import a.b.c as x, however, d->lz_from does not appear to be the module the attribute should be taken from: on the first step it is the full dotted name, and on later steps it is one component short of the base.
Activity
pythongh-157614: Make the lazy import subprocess test helper reusable
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Make the lazy import subprocess test helper reusable
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Make the lazy import subprocess test helper reusable
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
pythongh-157614: Make the lazy import subprocess test helper reusable
pythongh-157614: Fix lazy import a.b as c binding a.b.b instead of th…
grgalex commentedon Sep 16, 2026
@johnslavik I've opened the PR.
Next time I'll make sure not to link to the main issue during experimentation in the private fork to avoid polluting the issue with references!
StanFromIreland commentedon Sep 16, 2026
Marking as a release-blocker to get Hugo's eyes on this. This seems pretty bad, and seems like a realistic scenario to hit in practice.
[-]lazy import a.b as c incorrectly binds a.b.b[/-][+]`lazy import a.b as c` incorrectly binds to `a.b.b`[/+]grgalex commentedon Sep 18, 2026
Another bug found while investigating the present issue: #157757
hugovk commentedon Sep 28, 2026
Fixed by #158092, removing release-blocker label. Keeping this issue open for now to decide if we want the test from #157626.