Edgewall Software

Ticket #7510 (new defect)

Opened 5 months ago

Last modified 4 months ago

global name 'GeneratorExit' is not defined

Reported by: millman@… Owned by:
Priority: normal Milestone: 0.10.6
Component: general Version: 0.10.5
Severity: normal Keywords:
Cc:

Description

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

Change History

Changed 4 months ago by anonymous

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

Add/Change #7510 (global name 'GeneratorExit' is not defined)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from (none). Next status will be 'new'
The owner will change from (none) to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.