[issue15576] importlib: ExtensionFileLoader not used to load packages from __init__.so files

Stefan Behnel report at bugs.python.org
Sat Aug 11 06:28:44 CEST 2012


Stefan Behnel added the comment:

I understand that this is not trivial to test as part of the regression test suite. However, when I try it now I get this:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "__init__.py", line 8, in init my_test_package (my_test_package/__init__.c:1032)
SystemError: Parent module 'my_test_package' not loaded, cannot perform relative import

This is running Cython's "initial_file_path" test, which is meant to check that we provide a fake __path__ for the package module for the init function (as long as issue13429 isn't resolved).

The test code is here, failing in line 21 (each section is a separate file):

https://github.com/cython/cython/blob/master/tests/run/initial_file_path.srctree

I'm running the test like this:

python3 runtests.py --no-cpp --no-pyregr --no-unit --debug -vv initial_file_path

I also let it print sys.modules and the package isn't registered there yet at the time of the import.

----------

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


More information about the Python-bugs-list mailing list