Got it. The problem is that you are using an internal object here
(rows.response)
status, response.flash = client.accept(rows.colnames,
rows.response)
and something has changed in there. Notice the error is not in the
server but in the client. rows is a Rows object generated by
db(....).select().
Somehow before, it was returning strings for dates. Now it is
returning datetime.date objects from data and the ServerProxy client
does not know how to serialize that. when sending the request to the
server.
Try replace
client = xmlrpclib.ServerProxy(target+'/current/
handle',allow_none=True)
with
client = xmlrpclib.ServerProxy(target+'/current/
handle',allow_none=True,use_datetime=True)
On Jan 17, 1:49 pm, fpp <[email protected]> wrote:
> Hi,
>
> I have this very old web2py app that has been working 24/7 since early
> 2008...
>
> One instance runs on my phone (Nokia N900, a Linux device), another on
> my home server (also Linux).
>
> The mobile instance frequently "pushes" database records to the server
> instance, using XMLRPC, by calling the relevant method on the remote,
> something like :
>
> client = xmlrpclib.ServerProxy(target+'/current/handle',
> allow_none=True)
> rows = db(db.current.id>0).select()
> status, response.flash = client.accept(rows.colnames,
> rows.response)
>
> This has been running flawlessly for four years, although both ends
> have sometimes been upgraded :
>
> * the mobile instance runs a semi-recent version of web2py (1.94.5) on
> an old version of Python (2.5.4)
> * the server instance does the opposite (Python 2.7 and web2py
> 1.56.1 !)
> * so this is a fairly change-resistant combination so far...
>
> However, today I tried the latest web2py (1.99.4), because I wanted to
> host the mobile instance on an Android phone. After fighting my way
> through Android and SL4A to the underlying Linux core, I got it to run
> nicely, except for that "push" code above, which fails on the third
> line with :
>
> TypeError: cannot marshal <type 'datetime.date'> objects
>
> Now, obviously, one of the columns in rows.response contains a
> datetime.date value. But why is this suddenly a problem ? I moved the
> whole thing to a Windows box (with Python 2.6.5) and got the same
> result.
>
> Could this be caused by the newer version of web2py ? Where to start
> looking ?
>
> Thanks for any ideas,
> fp