Opened 10 years ago

Closed 9 years ago

#3734 closed (fixed)

__loader__ support for debugging module

Reported by: Armin Ronacher Owned by: Adrian Holovaty
Component: Core (Other) Version: master
Severity: Keywords: debug, __loader__
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The Import Hook PEP provides ways to get the sourcecode of modules imported using an import hook like the zipimporter or others. Django does not use this currently. But it would be a good thing if it would do because python eggs, and many template engines use it.

Attachments (2)

debug.patch (3.3 KB) - added by Armin Ronacher 9 years ago.
adds loader support to django
debug_with_traceback_hide.patch (3.7 KB) - added by Armin Ronacher 9 years ago.
like the other patch but with additional support for traceback_hide

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by Armin Ronacher

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

I don't have a patch yet but some sourcecode from the colubrid package that provides this: http://trac.pocoo.org/browser/colubrid/trunk/colubrid/debug.py

comment:2 Changed 10 years ago by Ramiro Morales <rm0 _at_ gmx.net>

Armin, ticket #3527 proposed the same and has been closed as wontfix, see the comments there fot rationale.

comment:3 in reply to:  2 ; Changed 10 years ago by mir@…

Replying to Ramiro Morales <rm0 _at_ gmx.net>:

Armin, ticket #3527 proposed the same [...]

Ramiro, #3527 is about "better debug traceback with code executing". Did you confuse it with another ticket?

comment:4 in reply to:  3 Changed 10 years ago by Ramiro Morales

Replying to mir@noris.de:

Replying to Ramiro Morales <rm0 _at_ gmx.net>:

Armin, ticket #3527 proposed the same [...]

Ramiro, #3527 is about "better debug traceback with code executing". Did you confuse it with another ticket?

Sorry, I totally missed the point. I thought this ticket was also asking for the integration of fancy stack traces
with more debugging info about the modules. Please disregard my comment.

comment:5 Changed 10 years ago by Simon G. <dev@…>

Keywords: debug __loader__ added
Summary: __loader__ support for debuggin module__loader__ support for debugging module
Triage Stage: UnreviewedDesign decision needed

comment:6 Changed 10 years ago by Armin Ronacher

Ramiro: Not, not code execution. Just the ability of seeing the sourcecode of eggs, zipfiles imported etc. Unfortunately django doesn't use linecache but file() directly, so that this doesn't work out of the box.

comment:7 Changed 9 years ago by Armin Ronacher

I created a patch now. Note on the additional escapes: it's likely that there is a value called "<module>" or "<unknown>" so it's better to escape that.

Changed 9 years ago by Armin Ronacher

Attachment: debug.patch added

adds loader support to django

comment:8 Changed 9 years ago by anonymous

Has patch: set

Changed 9 years ago by Armin Ronacher

like the other patch but with additional support for traceback_hide

comment:9 Changed 9 years ago by Simon G. <dev@…>

Triage Stage: Design decision neededReady for checkin

This looks good to me.

comment:10 Changed 9 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [5051]) Fixed #3734 -- Added support for import hooks to the debugging traceback
output. Also respect hidden traceback frames. Thanks to Armin Ronacher.

Note: See TracTickets for help on using tickets.
Back to Top