In [https://github.com/django/django/pull/8880 GitHub #8880] I'm proposing
a fix for this. If we fail to load the source file, we no longer drop the
frame but present what information we have, namely file name, line number
and function name, plus a warning about the unavability of the source file
in place of the actual source test.
Note that having a [https://www.python.org/dev/peps/pep-0302/#optional-
extensions-to-the-importer-protocol PEP 302] {{{__loader__}}} to the
generated module to provide a {{{get_source}}} method is a way of
supporting source code even for generated or custom-loaded code, and it is
supported by Django. So this change here does not affect all generated or
custom-loaded code, only those parts which don't make use of such a
loader.
--
Ticket URL: <https://code.djangoproject.com/ticket/28485>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "f51ded156e1b8ef8b59bc10b01100de6c3021ab3.patch" added.
GitHub8880.patch
Comment (by Srinivas Reddy Thatiparthy):
PR is here - https://github.com/django/django/pull/8880
--
Ticket URL: <https://code.djangoproject.com/ticket/28485#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28485#comment:2>
* status: new => closed
* owner: (none) => Tim Graham <timograham@…>
* resolution: => fixed
Comment:
In [changeset:"71d39571f46701a5a65adf8bf21005a177cda11f" 71d39571]:
{{{
#!CommitTicketReference repository=""
revision="71d39571f46701a5a65adf8bf21005a177cda11f"
Fixed #28485 -- Made ExceptionReporter.get_traceback_frames() include
frames without source code.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28485#comment:3>