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

2017-07-22 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 -- nos

[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 tracke

[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 c

[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 Yongzhi Pan
Changes by Yongzhi Pan : -- nosy: +fossilet ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[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 ___ ___ Python-bugs-list mailing list Unsubscribe: htt

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

2016-01-14 Thread Wil D'Amato
Changes by Wil D'Amato : -- nosy: +auslander1970 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

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

2016-01-14 Thread Chris Angelico
Chris Angelico added the comment: This still happens in current CPython, and doesn't even require a package: rosuav@sikorsky:~$ echo 'from . import x' >syserr.py rosuav@sikorsky:~$ python3 syserr.py Traceback (most recent call last): File "syserr.py", line 1, in from . import x SystemErro

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

2013-05-23 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

[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 Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[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 messag

[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 "marsu/pi