[New-bugs-announce] [issue18018] SystemError: Parent module '' not loaded, cannot perform relative import

Florent Xicluna report at bugs.python.org
Mon May 20 03:01:48 CEST 2013


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/pilami.py", line 2, in <module>
    from .houba import bi
SystemError: Parent module '' not loaded, cannot perform relative import


In Python 3.2 (or Python 2.7):

./python3.2 marsu/pilami.py

Traceback (most recent call last):
  File "marsu/pilami.py", line 2, in <module>
    from .houba import bi
ValueError: Attempted relative import in non-package

----------
components: Interpreter Core
keywords: 3.3regression
messages: 189630
nosy: brett.cannon, eric.snow, flox, ncoghlan
priority: normal
severity: normal
status: open
title: SystemError: Parent module '' not loaded, cannot perform relative import
type: behavior
versions: Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18018>
_______________________________________


More information about the New-bugs-announce mailing list