Ticket #3066 defect closed fixed
twisted.words.xish.utility.addOnetimeObserver can register a permanent xml stream observer
| Reported by: | jgill | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | words | Keywords: | |
| Cc: | jgill, ralphm, therve | Branch: | branches/xish-nested-dispatch-3066 |
| Author: | ralphm | Launchpad Bug: |
Description
twisted.words.xish.utility.addOnetimeObserver() adds an observer to an XPath event on an xml stream. Under some situations the method will defer appending the callback to the callback queue, e.g. if is in the middle of a dispatch call. The queued command, however, calls addObserver() rather than _addObserver(), and therefore drops the 'onetime' flag.
A simple fix might be to change the lambda call near the start of _addObserver() from
lambda:self.addObserver(event, observerfn, priority, *args, **kwargs)
to:
lambda:self._addObserver(onetime, event, observerfn, priority, *args, **kwargs)
Change History
Note: See
TracTickets for help on using
tickets.
