Code

Opened 7 years ago

Closed 7 years ago

#3734 closed (fixed)

__loader__ support for debugging module

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

Download all attachments as: .zip

Change History (12)

comment:1 Changed 7 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 follow-up: Changed 7 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 ; follow-up: Changed 7 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 7 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 7 years ago by Simon G. <dev@…>

  • Keywords debug, __loader__ added
  • Summary changed from __loader__ support for debuggin module to __loader__ support for debugging module
  • Triage Stage changed from Unreviewed to Design decision needed

comment:6 Changed 7 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 7 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 7 years ago by Armin Ronacher

adds loader support to django

comment:8 Changed 7 years ago by anonymous

  • Has patch set

Changed 7 years ago by Armin Ronacher

like the other patch but with additional support for traceback_hide

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

  • Triage Stage changed from Design decision needed to Ready for checkin

This looks good to me.

comment:10 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.