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
comment:2 Changed 18 years ago by
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
Status: | new → assigned |
---|
Thanks for chasing this down. I'll commit the fix over the weekend.
comment:4 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Same here ( trac 0.9.6 )