Author Ben Lewis2
Recipients Ben Lewis2
Date 2019-06-26.09:11:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561540286.77.0.471225789226.issue37409@roundup.psfhosted.org>
In-reply-to
Content
>>> from curses import ascii
>>> from . import ascii

The second line should raise an ImportError but instead succeeds (tested cpython 3.6.7, 3.7.0 and 3.7.3, and from interactive interpreter and scripts). Specifically, builtins.__import__ does not reproduce the behaviour of importlib._bootstrap.__import__; maybe ceval.c:import_from is neglecting to check that there are parent packages when attempting a relative import?

More details here: https://stackoverflow.com/a/56768129/5104777
History
Date User Action Args
2019-06-26 09:11:26Ben Lewis2setrecipients: + Ben Lewis2
2019-06-26 09:11:26Ben Lewis2setmessageid: <1561540286.77.0.471225789226.issue37409@roundup.psfhosted.org>
2019-06-26 09:11:26Ben Lewis2linkissue37409 messages
2019-06-26 09:11:26Ben Lewis2create