Opened 13 years ago

Closed 13 years ago

#22 closed defect (fixed)

TypeError thrown in pubsub._onSubscriptions: 'Subscription object is not iterable'

Reported by: mmalone Owned by: ralphm
Priority: normal Milestone:
Component: generic Keywords: pubsub subscription
Cc:

Description

I'm using idavoll, which is built on top of wokkel, and I'm seeing the following error thrown when I send a request-subscriptions iq:

2008-09-27 18:07:49-0700 [XmlStream,client] Unhandled Error
	Traceback (most recent call last):
	  File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-i386.egg/twisted/internet/defer.py", line 106, in maybeDeferred
	    result = f(*args, **kw)
	  File "/Library/Python/2.5/site-packages/wokkel-0.4.0-py2.5.egg/wokkel/pubsub.py", line 713, in _onSubscriptions
	    
	  File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-i386.egg/twisted/internet/defer.py", line 195, in addCallback
	    callbackKeywords=kw)
	  File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-i386.egg/twisted/internet/defer.py", line 186, in addCallbacks
	    self._runCallbacks()
	--- <exception caught here> ---
	  File "/Library/Python/2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.5-i386.egg/twisted/internet/defer.py", line 328, in _runCallbacks
	    self.result = callback(self.result, *args, **kw)
	  File "/Library/Python/2.5/site-packages/wokkel-0.4.0-py2.5.egg/wokkel/pubsub.py", line 705, in toResponse
	    
	exceptions.TypeError: 'Subscription' object is not iterable

I've attached a patch to wokkel that fixes this issue for me, but I'm not familiar enough with the internals of wokkel or idavoll to know which is really to blame. It looks like an interface changed, and something didn't get updated properly. Anyways, the attached patch fixes things for me.

Attachments (1)

pubsub-request-subscriptions.diff (900 bytes) - added by mmalone 13 years ago.
pubsub request-subscriptions patch

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by mmalone

pubsub request-subscriptions patch

comment:1 Changed 13 years ago by ralphm

(In [63]) Create a test for the bug reported, re #22.

comment:2 Changed 13 years ago by ralphm

(In [64]) Applied supplied patch, re #22.

comment:3 Changed 13 years ago by ralphm

Your patch looks great. I added a test case before applying it, and your change makes it happy. The changes are in source:branches/pubsub-subscriptions-22. Merging this to trunk.

comment:4 Changed 13 years ago by ralphm

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

(In [67]) Make requests for subscriptions work again.

Author: mmalone (ralphm). Reviewer: ralphm. Fixes #22.

Note: See TracTickets for help on using tickets.