Search the web
Sign In
New User? Sign Up
json-rpc
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
json-rpc python example from http://json-rpc.org/wiki/python-json-r   Message List  
Reply | Forward Message #589 of 635 |
I downloaded and installed json-rpc for Python, ran the simple check
using the ServiceProxy inside a python shell, and it works fine!

But when I copy/paste the example code here

#!/usr/bin/env python
from jsonrpc import handleCGI, ServiceMethod

@ServiceMethod
def echo(msg):
return msg

if __name__ == "__main__":
handleCGI()
################## end

I immediately get this error:

Traceback (most recent call last):
File "foo.py", line 11, in ?
handleCGI()
File "/usr/lib/python2.4/site-packages/jsonrpc/cgiwrapper.py", line
45, in handleCGI
CGIServiceHandler(service).handleRequest(fin, fout, env)
File "/usr/lib/python2.4/site-packages/jsonrpc/cgiwrapper.py", line
25, in handleRequest
resultData = ServiceHandler.handleRequest(self, data)
File "/usr/lib/python2.4/site-packages/jsonrpc/serviceHandler.py",
line 78, in handleRequest
resultdata = self.translateResult(result, err, id_)
File "/usr/lib/python2.4/site-packages/jsonrpc/serviceHandler.py",
line 104, in translateResult
err = {"name": err.__class__.__name__, "message":err.message}
AttributeError: ServiceRequestNotTranslatable instance has no
attribute 'message'

Am I doing something really silly that's causing this?

Thanks!
Paul




Thu Aug 16, 2007 9:33 pm

the_paul_silvis
Offline Offline
Send Email Send Email

Forward
Message #589 of 635 |
Expand Messages Author Sort by Date

I downloaded and installed json-rpc for Python, ran the simple check using the ServiceProxy inside a python shell, and it works fine! But when I copy/paste the...
the_paul_silvis
Offline Send Email
Aug 16, 2007
9:37 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help