[Cython] Failing test reimport_from_subinterpreter

Stefan Behnel stefan_ml at behnel.de
Tue Oct 16 14:30:25 EDT 2018


Jeroen Demeyer schrieb am 16.10.2018 um 12:42:
> I'm getting various reports of the test reimport_from_subinterpreter
> failing (within Sage, Cython 0.29, Python 2.7.15).
> 
> Annoyingly, the problem can only be reproduced when running the full Cython
> testsuite, not when running the test in isolation. I'll continue to
> investigate, but I'm already posting it here in case somebody has an idea.
> The error is not very enlightening (is there a way to get the exception
> from the subinterpreter?):
> 
> End-to-end reimport_from_subinterpreter ...
> /home/jdemeyer/sage-test/local/bin/python2 setup.py build_ext --inplace
> Compiling package/subtest.pyx because it changed.
> Compiling subtest.pyx because it changed.
> [1/2] Cythonizing package/subtest.pyx
> [2/2] Cythonizing subtest.pyx
> running build_ext
> building 'package.subtest' extension
> creating build
> creating build/temp.linux-ppc64le-2.7
> creating build/temp.linux-ppc64le-2.7/package
> gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused
> -fPIC -I/home/jdemeyer/sage-test/local/include/python2.7 -c
> package/subtest.c -o build/temp.linux-ppc64le-2.7/package/subtest.o
> gcc -pthread -shared -L/home/jdemeyer/sage-test/local/lib
> -Wl,-rpath,/home/jdemeyer/sage-test/local/lib
> -L/home/jdemeyer/sage-test/local/lib
> -Wl,-rpath,/home/jdemeyer/sage-test/local/lib
> build/temp.linux-ppc64le-2.7/package/subtest.o
> -L/home/jdemeyer/sage-test/local/lib -lpython2.7 -o
> /home/jdemeyer/sage-test/local/var/tmp/sage/build/cython-0.29/src/TEST_TMP/run/reimport_from_subinterpreter/package/subtest.so
> 
> building 'subtest' extension
> gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused
> -fPIC -I/home/jdemeyer/sage-test/local/include/python2.7 -c subtest.c -o
> build/temp.linux-ppc64le-2.7/subtest.o
> gcc -pthread -shared -L/home/jdemeyer/sage-test/local/lib
> -Wl,-rpath,/home/jdemeyer/sage-test/local/lib
> -L/home/jdemeyer/sage-test/local/lib
> -Wl,-rpath,/home/jdemeyer/sage-test/local/lib
> build/temp.linux-ppc64le-2.7/subtest.o -L/home/jdemeyer/sage-test/local/lib
> -lpython2.7 -o
> /home/jdemeyer/sage-test/local/var/tmp/sage/build/cython-0.29/src/TEST_TMP/run/reimport_from_subinterpreter/subtest.so
> 
> 
> /home/jdemeyer/sage-test/local/var/tmp/sage/build/cython-0.29/src/Cython/Compiler/Main.py:367:
> FutureWarning: Cython directive 'language_level' not set, using 2 for now
> (Py2). This will change in a later release! File:
> /home/jdemeyer/sage-test/local/var/tmp/sage/build/cython-0.29/src/TEST_TMP/run/reimport_from_subinterpreter/package/subtest.pyx
> 
>   tree = Parsing.p_module(s, pxd, full_module_name)
> /home/jdemeyer/sage-test/local/var/tmp/sage/build/cython-0.29/src/Cython/Compiler/Main.py:367:
> FutureWarning: Cython directive 'language_level' not set, using 2 for now
> (Py2). This will change in a later release! File:
> /home/jdemeyer/sage-test/local/var/tmp/sage/build/cython-0.29/src/TEST_TMP/run/reimport_from_subinterpreter/subtest.pyx
> 
>   tree = Parsing.p_module(s, pxd, full_module_name)
> 
> 
> /home/jdemeyer/sage-test/local/bin/python2 -c "import subtest;
> subtest.run_main()"
> Module loaded: package.subtest
> 
> 
> 
> /home/jdemeyer/sage-test/local/bin/python2 -c "import subtest;
> subtest.run_sub()"
> 
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> ImportError: No module named package

The error message is right above. ^^^


> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "subtest.pyx", line 44, in subtest.run_sub
>     assert 0 == run_in_subinterpreter(b'import package')
> AssertionError

Difficult to say why this would fail to find the package. Could it be an
import path problem? Current directory missing from the PYTHONPATH or
something like that?

Stefan


More information about the cython-devel mailing list