Ticket #4503 defect closed fixed
domish gets confused by spaces in xmlns names
| Reported by: | michich | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | words | Keywords: | |
| Cc: | Branch: | branches/domish-xmlns-spaces-4503 | |
| Author: | exarkun | Launchpad Bug: |
Description
I maintain the package Jabbim in Fedora. It's a Twisted-based XMPP client. Leandro Vázquez Cervantes reported to me a crash in Jabbim which turns out to be a bug in Twisted:
File "/usr/lib/python2.6/site-packages/twisted/internet/tcp.py", line 140, in doRead return Connection.doRead(self) File "/usr/lib/python2.6/site-packages/twisted/internet/tcp.py", line 463, in doRead return self.protocol.dataReceived(data) File "/usr/lib/python2.6/site-packages/twisted/words/xish/xmlstream.py", line 75, in dataReceived self.stream.parse(data) File "/usr/lib/python2.6/site-packages/twisted/words/xish/domish.py", line 756, in parse self.parser.Parse(buffer) File "/usr/lib/python2.6/site-packages/twisted/words/xish/domish.py", line 774, in _onStartElement e = Element(qname, self.defaultNsStack[-1], attrs, self.localPrefixes) File "/usr/lib/python2.6/site-packages/twisted/words/xish/domish.py", line 404, in __init__ self.uri, self.name = qname exceptions.ValueError: too many values to unpack
After some googling I found the same bug was affecting pyaimt in Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583263
It happens when a received stanza contains spaces in a xmlns, e.g.:
<data xmlns="http://www.xmpp.org/extensions/xep-0084.html#ns-data ">
(notice the space before the closing quotation mark)
I don't know if any standard forbids spaces in xmlns IRIs, but a ValueError is certainly not an acceptable result.
The attached patch fixes it.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

