Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#9421 closed enhancement (fixed)

Also show source on error page when code is packaged as egg

Reported by: Remy Blank Owned by: Remy Blank
Priority: high Milestone: 0.12
Component: general Version: 0.12dev
Severity: normal Keywords: error
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The traceback on the internal error page shows a snippet of the source code around the line where the exception occurred. This works well when the source files are directly available, but not when they are packaged as an .egg.

I have a patch that makes this work, and even simplifies the current code.

Attachments (0)

Change History (2)

comment:1 by Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

Patch applied in [9858], tested on Linux (with Python 2.4, 2.5 and 2.6), OS X (2.6), Windows XP (2.6), Windows Vista (2.6) and Windows 7 (2.6), with an egg generated with Linux and Windows 7.

The simplified code (using only the linecache module) only works reliably on Python 2.6. Prior versions return lines from the wrong file, so an explicit scan for eggs in sys.path had to be added.

comment:2 by Christian Boos, 14 years ago

Great job Remy, verified to work on my production system on Linux (build/bdist.linux-x86_64/egg/trac/...) and on my test systems on Windows (build/bdist.win32/egg/trac/..., 2.4.4, 2.5.4, 2.6.5 and 2.7rc1).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.