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
sys.set_lazy_imports_filter loses information when doing relative imports #148026
The problem is that the filter gets a relative path, but nothing indicates that, so there is no way to distinguish between from uhoh import x and from .uhoh import x.
The PEP doesn't really touch on what the right thing is here.
Potential fixes:
Put a leading . in the name, so .uhoh in that case
Turn it into a fully resolved path, so test.uhoh. (Assuming we have the info to do it at that point? I haven't looked carefully yet)
One other snag is that if option 1 is chosen, we still wouldn't be able to resolve the location when the importer is __main__ (unless we could also change that).
Activity
brittanyrey commentedon Apr 3, 2026
I think we probably want to pass back the absolute path to the user here. (option 2)
picnixz commentedon Apr 4, 2026
So, Pablo opened a duplicate issue but since he is one of the PEP authors and already has a fix for it I am going to close this one
from x import yandfrom .x import y#148110pablogsal commentedon Apr 4, 2026
whops! Sorry @msullivan i totally missed this issue :(