ionelmc / python-hunter

Hunter is a flexible code tracing toolkit.
https://python-hunter.readthedocs.io/
BSD 2-Clause "Simplified" License
800 stars 47 forks source link

Tracing cython code #30

Closed licnep closed 8 years ago

licnep commented 8 years ago

hunter.trace() fails to print the source code for cython modules, even when they are cythonized with linetracing enabled (eg. when an exception happens the source code is shown).

Instead of showing the pyx source, hunter currently outputs lines like this:

cythonLib.so:275 line ??? NO SOURCE: SyntaxError("invalid or missing encoding declaration for '/usr/local/lib/python3.5/dist-packages/cythonLib.so'")

ionelmc commented 8 years ago

This is supported now. Note that you need to enable line tracing (see tests/sample5.pyx and tests/setup.py for what I tested with).

licnep commented 8 years ago

Awesome!