This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients brett.cannon, eric.snow, erik.bray, jdemeyer, ncoghlan, paul.moore, petr.viktorin, sth
Date 2018-08-04.14:17:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533392270.13.0.56676864532.issue32797@psf.upfronthosting.co.za>
In-reply-to
Content
This problem isn't unique to Cython extension modules - it exists for pyc-only distribution of pure Python files as well.

The underlying problem is that we don't currently have a mechanism comparable to JavaScript source maps, whereby a preprocessed runtime artifact can provide a reference back to a more debugging-friendly representation that's stored somewhere else (whether that's adjacent to the compiled form, in a different directory elsewhere on the same machine, or even on a remote web server).

So I think asking how ExtensionFileLoader.get_source() should behave is likely looking at the problem at the wrong level: a better question may be to ask what feature *linecache* is missing to allow it to correctly report source lines for modules that do *not* include their source code when installed, but do have that source code available in a shadow directory, where the only things that change are the root location (which could potentially even be a HTTP or HTTPS URL), and a fixed transformation on the module filename itself (e.g. replacing "*.so" with "*.c", or "*.pyc" with "*.py").

Given such a feature in Python 3.8, and support for it in Cython, the enhanced linecache module could then be published to PyPI as backports.linecache, providing access to this improved behaviour on all Python 3 versions that SageMath wants to support.
History
Date User Action Args
2018-08-04 14:17:50ncoghlansetrecipients: + ncoghlan, brett.cannon, paul.moore, petr.viktorin, erik.bray, eric.snow, sth, jdemeyer
2018-08-04 14:17:50ncoghlansetmessageid: <1533392270.13.0.56676864532.issue32797@psf.upfronthosting.co.za>
2018-08-04 14:17:50ncoghlanlinkissue32797 messages
2018-08-04 14:17:49ncoghlancreate