#10711 closed defect (cantfix)
trac0.12's xmlrpc can't update.ticket
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
trac 0.12.3 xmlrpc r11610(svn)
code:
# -*- coding: utf-8 -*- #!/bin/python from xmlrpclib import ServerProxy,DateTime p = ServerProxy('https://bodhi:123123@www1.test.com/projects/test/login/xmlrpc') a=p.ticket.get(1553) print a b=a[3] b['status']='new' p.ticket.update(1553,"closed by bodhi",b,False,'bodhi')
run it,and error:
Traceback (most recent call last): File "tracxmlrpc.py", line 32, in <module> p.ticket.update(1553,"closed by bodhi",b,False,'bodhi') File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request verbose=self.__verbose File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request return self._parse_response(h.getfile(), sock) File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response return u.close() File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: <Fault 1: "''datetime.datetime' object has no attribute 'strip'' while executing 'ticket.update()'">
Attachments (0)
Change History (4)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → cantfix |
---|---|
Status: | new → closed |
Version: | 0.12.3 |
No, PluginIssue (th:XmlRpcPlugin).
And, cannot update time
and changetime
attributes of ticket.
del b['time'] del b['changetime']
comment:3 by , 11 years ago
Also getting this exact issue. I noticed the ticket is closed, but will try the suggested fix. The "No, Plugin issues" comment leaves a bit more to be desired.
comment:4 by , 11 years ago
Tried the suggested "hack" to use try/except clause around the strip and it works great. I guess the problem is with Python we don't know what object is coming in. Any other 'proper' suggestions would be welcome.
I found after analysis of the source, modify trac/ticket/model.py: (155)
to
is OK!