Ah, understood regarding gdb-python3.
sagemath uses cysignals-CSI from the cysignals-tools package to print out a
more detailed backtrace containing native, cython and python code, when tests
cysignals-CSI starts gdb and writes the contents of cysignals-CSI-helper.py 
into gdb. That script does things like "from Cython.Debugger import libpython,
libcython". If gdb (instead of gdb-python2) is used then this fails with an
Traceback (most recent call last):
File "", line 26, in
ModuleNotFoundError: No module named 'Cython'
Error while executing Python code.
because currently we only install cython for python2 when building sagemath.
So, gdb's libpython3 can't find the Cython module.
After replacing gdb with gdb-python2 I get a nice Cython backtrace instead.
 The Debian package installs this file into
/usr/lib/python3/dist-packages/cysignals_gdb/cysignals-CSI-helper.py but that
is a Debian-specific innovation by the package maintainer that is slightly
misleading; the file is just meant to be read into gdb rather than imported in
a python program.
> On 12.02.2018 15:41, Ximin Luo wrote:
>> Understood, but the entirety of sagemath is python2 at the moment and
>> doesn't support python3 (upstream is working on it).
>> What's the timeframe for removal of gdb-python2 and will there be a
>> gdb-python3 alternative?
> gdb is built using python3. So maybe there is a misunderstanding, but how
> sagemath use python for debugging? Does it add it's own pretty printers so
> it needs python2? How is the gdb usage related to Python2?
debian-science-maintainers mailing list