[IPython-dev] fix_frame_records_filenames() messes up Cython tracebacks

Jeroen Demeyer jdemeyer at cage.ugent.be
Thu Nov 20 10:04:41 EST 2014


In IPython/core/ultratb.py, the fix_frame_records_filenames() tries to 
"correct" filenames in tracebacks. However, for tracebacks coming from 
Cython, this actually replaces the perfectly fine .pyx source filename 
by the compiled .so filename.

So here is a suggestion: in fix_frame_records_filenames(), check that 
the better_fn() is not a binary file(*) and only then do the 
replacement. This would be easy to implement, any objections?

I am asking this because Sage heavily uses Cython and this is annoying.


(*) the standard way of doing this is to check for \x00 bytes.



More information about the IPython-dev mailing list