Modify

Opened 18 years ago

Closed 18 years ago

#594 closed defect (fixed)

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

Reported by: dev Owned by: Alec Thomas
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 18 years ago by nextime

Same here ( trac 0.9.6 )

comment:2 Changed 18 years ago by Robert Kieffer

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 18 years ago by Alec Thomas

Status: newassigned

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

comment:4 Changed 18 years ago by Alec Thomas

Resolution: fixed
Status: assignedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.