ticket.get appears to die on ticket custom fields
|Reported by:||greg@…||Owned by:||osimons|
When trying to use ticket.get() against my trac installation I get a TypeError exception from dump_struct in xmlrpclib.py due to the type of one of my custom fields not being string. They are, in fact type 'unicode' so I'm not really sure if they are wrong or the plugin is wrong but either way it doesn't seem to work. This was also posted to the trac mailing list.
Sorry to respond to my own post but I've been debugging this a bit and have more of an idea of what is going on. I played around with the exception handling in xmlrpclib.py. It turns out the TypeError exception gets thrown on one of my custom ticket fields. The field is defined in trac.ini as: verified = checkbox verified.label = Fix Verified verified.value = 0 verified.order = 7 and the type is somehow unicode. I have a few other checkbox custom fields and if they are processed in order then they are all fine. This is the same field I had problems with in ticket #3939 so now I'm wondering if there is just something dodgy with that field. Anyone have an idea of how to track this down? Thanks, Greg On Sat, 2006-11-04 at 18:23 -0500, Greg Dickie wrote: > Hi, > > Sorry in advance if this is a FAQ but I'm an xmlrpc virgin ;-). I want > to use xmlrpc to create tickets a part of a merge review process but I > can't even get the examples to work right ;-). This is trac 0.10 and > using the example: > > import xmlrpclib > > server = xmlrpclib.ServerProxy("http://trac/Sledgehammer/xmlrpc") > > multicall = xmlrpclib.MultiCall(server) > for ticket in server.ticket.query("owner=greg"): > multicall.ticket.get(ticket) > print map(str, multicall()) > > > gives this: > > Traceback (most recent call last): > File "tt", line 8, in ? > print map(str, multicall()) > File "/usr/lib/python2.4/xmlrpclib.py", line 945, in __call__ > return > MultiCallIterator(self.__server.system.multicall(marshalled_list)) > File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__ > return self.__send(self.__name, args) > File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request > verbose=self.__verbose > File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request > return self._parse_response(h.getfile(), sock) > File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response > return u.close() > File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close > raise Fault(**self._stack) > xmlrpclib.Fault: <Fault 2: "'dictionary key must be string' while > executing 'system.multicall()'"> > > > which seems to be to be a problem in the data being received. > > Anyone know what I'm doing wrong? > > Thanks, > Greg >
Change History (13)
comment:12 Changed 5 years ago by thijs
- Cc thijs added; anonymous removed
- Owner changed from athomas to osimons