Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

#7510 closed defect (wontfix)

global name 'GeneratorExit' is not defined

Reported by: millman@… Owned by:
Priority: normal Milestone:
Component: general Version: 0.10.5
Severity: normal Keywords: python24
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

With Python 2.4 and Trac 10.5 certain macros (e.g., Image) raise an exception:

  global name 'GeneratorExit' is not defined

I think GeneratorExit was introduced in Python 2.5: http://docs.python.org/whatsnew/pep-342.html

Removing the following lines

 449                except GeneratorExit:
 450                    # never catch GeneratorExit
 451                    raise

from /usr/lib/python2.4/site-packages/trac/wiki/macros.py resolves this issue.

This is the reason the change in 10.5 was introduced: http://trac.edgewall.org/ticket/5339

Adding the following to the top of the module:

   try:
       GeneratorExit
   except NameError:
       class GeneratorExit(Exception): pass

would allow the fix for 5339 to stay.

Attachments (0)

Change History (3)

comment:1 by anonymous, 16 years ago

I can confirm that the fix suggested in the ticket works, after being hit by the same bug as well.

comment:2 by Christian Boos, 15 years ago

Description: modified (diff)
Keywords: python24 added
Milestone: 0.10.60.11.6

Seems indeed needed for 2.4

comment:3 by Christian Boos, 15 years ago

Milestone: 0.11.6
Resolution: wontfix
Status: newclosed

My bad, that except GeneratorExit: line is gone in 0.11, along with the UserMacroProvider. So this becomes a wontfix.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) 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.