Modify

Opened 8 years ago

Closed 8 years ago

#594 closed defect (fixed)

Error: Macro Poll(Test?; a; b) failed

Reported by: dev Owned by: athomas
Priority: normal Component: PollMacro
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

I tried PollMacro on my trac installation (current trunk) and tried the example from the wiki page. But I get only this error:

Error: Macro Poll(Test?; a; b) failed

keys

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by nextime@…

Same here ( trac 0.9.6 )

comment:2 Changed 8 years ago by robert@…

I've figured out the problem. This tracpoll.py code:

        self.votes.update([(k[0], []) for k in self.vote_defs
                           if k[0] not in self.votes])

... is relying on the Python 2.4 implementation of update(). The Python 2.3 version of update() doesn't take an array of tuples as an argument and throws the AttributeError. (This API change is documented in note #9 in http://docs.python.org/lib/typesmapping.html)

The solution is to change the above to:

        self.votes.update(dict([(k[0], []) for k in self.vote_defs
                           if k[0] not in self.votes]))

Which only leaves the question of how best to get this change back into the code?

(stacktrace of this bug available in the closed duplicate, #616)

comment:3 Changed 8 years ago by athomas

  • Status changed from new to assigned

Thanks for chasing this down. I'll commit the fix over the weekend.

comment:4 Changed 8 years ago by athomas

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

(In [1155]) Committed fix for Python 2.3, from robert@…. Closes #594.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.