[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2017-07-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c824cc8426a16dd9f3949a3ed135523d37787bae by Serhiy Storchaka in branch '3.5': [3.5] Backport bpo-30876 (GH-2639), bpo-18018 and bpo-26367. (#2677) https://github.com/python/cpython/commit/c824cc8426a16dd9f3949a3ed135523d37787bae --

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-22 Thread Brett Cannon
Brett Cannon added the comment: Thanks to everyone for providing feedback. I went with ImportError in the end as that's what the pure Python implementation of __import__() already raised. -- resolution: -> fixed stage: test needed -> resolved status: open -> closed

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset c4e4886c6052 by Brett Cannon in branch 'default': Issue #18018: Raise an ImportError if a relative import is attempted https://hg.python.org/cpython/rev/c4e4886c6052 -- nosy: +python-dev ___ Python

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-14 Thread Yongzhi Pan
Changes by Yongzhi Pan : -- nosy: +fossilet ___ Python tracker ___ ___ Python-bugs-list

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-14 Thread Brett Cannon
Brett Cannon added the comment: The problem is in Python/import.c: https://hg.python.org/cpython/file/default/Python/import.c#l1453 . While the Python code has a check that `package` is a truthy value, the accelerated C code doesn't. Adding a check that the string isn't empty or truthy should

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-14 Thread Chris Angelico
Chris Angelico added the comment: If someone made a new way of importing and had it raise ValueError on some issue or other, I think there'd be complete consensus that that's the wrong exception. Yes, this is incompatible with Python 2 - but there are a lot of corner cases in the 3.3+ import

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2016-01-14 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: flox -> brett.cannon ___ Python tracker ___ ___

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2013-05-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: User code should generally not see any SystemErrors (even when choosing wacky module names :-)), so IMHO this is a regression. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2013-05-23 Thread Brett Cannon
Brett Cannon added the comment: The line raising the exception is http://hg.python.org/cpython/file/f7992397e98d/Lib/importlib/_bootstrap.py#l1518 . If you're sure it's a regression feel free to change what exception is raised. -- assignee: - flox

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2013-05-19 Thread Florent Xicluna
New submission from Florent Xicluna: When executing a submodule, there's a SystemError in 3.3 where we used to receive a ValueError. mkdir marsu touch marsu/__init__.py echo from .houba import bi marsu/pilami.py ./python marsu/pilami.py Traceback (most recent call last): File

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2013-05-19 Thread Nick Coghlan
Nick Coghlan added the comment: For the specific case given, both error messages are misleading anyway - the problem is attempting to directly execute a module inside a package instead of using -m. However, for the case of attempting a relative import from a top level module, the old message

[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

2013-05-19 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18018 ___