Opened 16 years ago

Last modified 16 years ago

#734 defect closed fixed (fixed)

twisted/xish/ bug breaks jabber protocol implementation

Reported by: doko Owned by: dizzyd
Priority: high Milestone:
Component: Keywords:
Cc: dizzyd, jknight, doko Branch:


Change History (2)

comment:1 Changed 16 years ago by doko

[forwarded from]


On an application I'm working on which uses Twisted jabber protocol
implementation, I've encountered a bug in twisted.xish.domish which
makes it incompatible with some jabber clients which are unfortunately 
deployed where the app is going to be used. This bug was fixed some 
times ago in twisted SVN. Could you consider applying the following
tiny patch to the next upload of python-twisted? It comes straight from
the subversion rep of twisted, and fixes the bug. 

--- trunk/twisted/xish/	2003/12/27 03:43:18	9733
+++ trunk/twisted/xish/	2004/05/25 20:36:07	10781
@@ -38,6 +38,7 @@
     def __init__(self, prefixes = None):
         self.cio = StringIO.StringIO()
         self.prefixes = prefixes or {}
+        self.prefixes[""] = "xml"
         self.prefixCounter = 0
     def getValue(self):
@@ -87,7 +88,7 @@
         for k,v in elem.attributes.items():
             # If the attribute name is a list, it's a qualified attribute
             if isinstance(k, types.TupleType):
-                write(" %s:%s='%s'" % (self.getPrefix[k[0]], k[1],
escapeToXml(v, 1)).encode("utf-8"))
+                write((" %s:%s='%s'" % (self.getPrefix(k[0]), k[1],
escapeToXml(v, 1))).encode("utf-8"))
                 write((" %s='%s'" % ( k, escapeToXml(v, 1))).encode("utf-8"))
@@ -599,7 +600,8 @@
         # Process attributes
         for k, v in attrs.items():
             if k.find(" ") != -1:
-                attrs[k.split(" ")] = v
+                aqname = k.split(" ")
+                attrs[(aqname[0], aqname[1])] = v
                 del attrs[k]
         # Construct the new element


Best regards,


comment:2 Changed 16 years ago by jknight

Uh, according to report, "This bug was fixed some times ago in twisted SVN". It was just a request for a 
backport of a bugfix to the debian package. Closed.
Note: See TracTickets for help on using tickets.