Django

Code

Ticket #3734 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

__loader__ support for debugging module

Reported by: Armin Ronacher Assigned to: adrian
Milestone: Component: Core framework
Version: SVN Keywords: debug, __loader__
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

debug.patch (3.3 kB) - added by Armin Ronacher on 03/30/07 09:32:32.
adds loader support to django
debug_with_traceback_hide.patch (3.7 kB) - added by Armin Ronacher on 03/30/07 10:03:09.
like the other patch but with additional support for traceback_hide

Change History

03/15/07 03:19:42 changed by Armin Ronacher

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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

(follow-up: ↓ 3 ) 03/15/07 07:52:26 changed 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.

(in reply to: ↑ 2 ; follow-up: ↓ 4 ) 03/15/07 08:14:27 changed by 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?

(in reply to: ↑ 3 ) 03/16/07 05:19:07 changed 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.

03/18/07 05:00:15 changed by Simon G. <dev@simon.net.nz>

  • keywords set to debug, __loader__.
  • summary changed from __loader__ support for debuggin module to __loader__ support for debugging module.
  • stage changed from Unreviewed to Design decision needed.

03/22/07 08:25:53 changed 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.

03/30/07 09:31:53 changed 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.

03/30/07 09:32:32 changed by Armin Ronacher

  • attachment debug.patch added.

adds loader support to django

03/30/07 09:36:47 changed by anonymous

  • has_patch set to 1.

03/30/07 10:03:09 changed by Armin Ronacher

  • attachment debug_with_traceback_hide.patch added.

like the other patch but with additional support for traceback_hide

03/30/07 22:17:40 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Design decision needed to Ready for checkin.

This looks good to me.

04/20/07 23:37:32 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #3734 (__loader__ support for debugging module)




Change Properties
Action