Opened 17 years ago

Closed 17 years ago

#3734 closed (fixed)

__loader__ support for debugging module

Reported by: Armin Ronacher Owned by: Adrian Holovaty
Component: Core (Other) Version: dev
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: no UI/UX: no

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 17 years ago.
adds loader support to django
debug_with_traceback_hide.patch (3.7 KB ) - added by Armin Ronacher 17 years ago.
like the other patch but with additional support for traceback_hide

Download all attachments as: .zip

Change History (12)

comment:1 by Armin Ronacher, 17 years ago

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 by Ramiro Morales <rm0 _at_ gmx.net>, 17 years ago

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

in reply to:  2 ; comment:3 by mir@…, 17 years ago

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?

in reply to:  3 comment:4 by Ramiro Morales, 17 years ago

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 by Simon G. <dev@…>, 17 years ago

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

comment:6 by Armin Ronacher, 17 years ago

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 by Armin Ronacher, 17 years ago

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.

by Armin Ronacher, 17 years ago

Attachment: debug.patch added

adds loader support to django

comment:8 by anonymous, 17 years ago

Has patch: set

by Armin Ronacher, 17 years ago

like the other patch but with additional support for traceback_hide

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

Triage Stage: Design decision neededReady for checkin

This looks good to me.

comment:10 by Malcolm Tredinnick, 17 years ago

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