Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Transient error with data forms and PubSub set_node_config #219

Open
Schnouki opened this issue Feb 1, 2013 · 4 comments
Open

Transient error with data forms and PubSub set_node_config #219

Schnouki opened this issue Feb 1, 2013 · 4 comments

Comments

@Schnouki
Copy link

Schnouki commented Feb 1, 2013

Here's a test script I'd like to run on my server: http://pastebin.com/1QVw087F

Sometimes it works just fine:

$ ./pubsub-config.py
Version: (1, 1, 10, '', 0)

But sometimes it fails with the following error:

$ ./pubsub-config.py
Version: (1, 1, 10, '', 0)
Error processing event handler: <bound method PubsubClient.start of <__main__.PubsubClient object at 0x7fdb9510b350>>
Traceback (most recent call last):
  File "/home/schnouki/.local/lib/python3.3/site-packages/sleekxmpp-1.1.10-py3.3.egg/sleekxmpp/xmlstream/xmlstream.py", line 1567, in _threaded_event_wrapper
    func(*args)
  File "./pubsub-config.py", line 16, in start
    res = self["xep_0060"].set_node_config("buddycloud.pouet.im", "/user/test1@pouet.im/posts", form)
  File "/home/schnouki/.local/lib/python3.3/site-packages/sleekxmpp-1.1.10-py3.3.egg/sleekxmpp/plugins/xep_0060/pubsub.py", line 426, in set_node_config
    iq['pubsub_owner']['configure']['form'].values = config.values
  File "/home/schnouki/.local/lib/python3.3/site-packages/sleekxmpp-1.1.10-py3.3.egg/sleekxmpp/xmlstream/stanzabase.py", line 632, in _set_stanza_values
    self[full_interface] = value
  File "/home/schnouki/.local/lib/python3.3/site-packages/sleekxmpp-1.1.10-py3.3.egg/sleekxmpp/xmlstream/stanzabase.py", line 769, in __setitem__
    getattr(self, set_method)(value, **kwargs)
  File "/home/schnouki/.local/lib/python3.3/site-packages/sleekxmpp-1.1.10-py3.3.egg/sleekxmpp/plugins/xep_0004/stanza/form.py", line 223, in set_values
    fields[field]['value'] = values[field]
KeyError: 'pubsub#title'
'pubsub#title'

(Also happens with 1.1.11.)
I have no idea why this happens. Am I doing something wrong in the form creation?
(If you want access to my server to test this, feel free to ask.)

@legastero
Copy link
Collaborator

Python 3.3?

@legastero
Copy link
Collaborator

Ah, I see 3.3 in the paths now. I'll have to debug this some more. I've seen this with the test suite randomly failing on 3.3.

@Schnouki
Copy link
Author

Schnouki commented Feb 1, 2013

Oh, ok. Thanks.

@legastero
Copy link
Collaborator

It looks like there has been an unintentional dependency on consistent ordering when iterating over dictionary keys, which appears to have changed in 3.3.

So copying a stanza by doing new_stanza.values = old_stanza.values randomly fails.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants