joshmarshall / jsonrpclib

A Python JSON-RPC over HTTP that mirrors xmlrpclib syntax.
Other
447 stars 144 forks source link

Incorrect exception when passing a variable of type set #57

Open eyurtsev opened 8 years ago

eyurtsev commented 8 years ago
import jsonrpclib

server = jsonrpclib.Server('http://localhost:5003/api')
server.any_function(any_variable=set()) #  <-- Should fail, but with a better exception

Produces the following exception which makes it difficult to troubleshoot the cause:

---> 63     module_name = inspect.getmodule(obj).__name__
     64     class_name = obj.__class__.__name__
     65     json_class = class_name

AttributeError: 'NoneType' object has no attribute '__name__'
anxuae commented 5 years ago

Hi,

I have the same issue this the bytearray type. I guess that is because we are using builtin types. And thus there is no real module where the class is defined.

The builtin types should be managed case by case in the jsonclass.py module.

@joshmarshall are you still maintening this lib? Seem that last update on pypi is quite old. Maybe there is aother alternative to this lib?