[New-bugs-announce] [issue30876] SystemError on import

Serhiy Storchaka report at bugs.python.org
Sat Jul 8 01:07:16 EDT 2017


New submission from Serhiy Storchaka:

It is possible to get SystemError on import (see attached archive).

$ ./python -c 'import package.module1'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/serhiy/py/cpython/package/module1.py", line 3, in <module>
    from . import module2
SystemError: Parent module 'package' not loaded, cannot perform relative import

SystemError means a programming error in interpreter core or extension. It is comparable to an assert in C code, but without immediate crashing. Since this situation can be provoked by user code, it should be replaced with other exception (KeyError, RuntimeError, ImportError, etc).

----------
components: Interpreter Core
files: import-systemerror.zip
messages: 297940
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
status: open
title: SystemError on import
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46997/import-systemerror.zip

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


More information about the New-bugs-announce mailing list