tests.py Failed with 8 errors

211 views
Skip to first unread message

Derrick Betts

unread,
Oct 12, 2012, 10:30:01 PM10/12/12
to jsonr...@googlegroups.com
I installed the library and have been trying to find out why I'm getting this error when JSON string is sent to the server:
     192.168.1.107 - - [12/Oct/2012 20:13:07] code 400, message Bad request syntax ('{"jsonrpc":"2.0","method":"add","id":"8"}')
     192.168.1.107 - - [12/Oct/2012 20:13:07] "{"jsonrpc":"2.0","method":"add","id":"8"}" 400 -

So, I ran the tests.py script and received the following:

===============================================================
  NOTE: There may be threading exceptions after tests finish.
===============================================================
....................EEEEEEEE
======================================================================
ERROR: test_connect (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 279, in test_connect
    result = client.ping()
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 276, in __call__
    return self.__send(self.__name, kwargs)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 224, in _request
    response = self._run_request(request)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_multicall_failure (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 341, in test_multicall_failure
    result = multicall()
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 362, in _request
    responses = self._server._run_request(request_body)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_multicall_success (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 333, in test_multicall_success
    result = multicall()
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 362, in _request
    responses = self._server._run_request(request_body)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_single_args (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 284, in test_single_args
    result = client.add(5, 10)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 274, in __call__
    return self.__send(self.__name, args)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 224, in _request
    response = self._run_request(request)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_single_kwargs (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 289, in test_single_kwargs
    result = client.add(x=5, y=10)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 276, in __call__
    return self.__send(self.__name, kwargs)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 224, in _request
    response = self._run_request(request)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_single_kwargs_and_args (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 294, in test_single_kwargs_and_args
    self.assertRaises(ProtocolError, client.add, (5,), {'y':10})
  File "/usr/lib/python2.7/unittest/case.py", line 471, in assertRaises
    callableObj(*args, **kwargs)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 274, in __call__
    return self.__send(self.__name, args)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 224, in _request
    response = self._run_request(request)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_single_namespace (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 303, in test_single_namespace
    response = client.namespace.sum(1,2,4)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 274, in __call__
    return self.__send(self.__name, args)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 224, in _request
    response = self._run_request(request)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_single_notify (__main__.UnixSocketInternalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 298, in test_single_notify
    result = client._notify.add(5, 10)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 274, in __call__
    return self.__send(self.__name, args)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 231, in _request_notify
    response = self._run_request(request, notify=True)
  File "/Downloads/jsonrpclib/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1303, in single_request
    self.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1378, in close
    if self._connection[1]:
TypeError: 'NoneType' object has no attribute '__getitem__'

----------------------------------------------------------------------
Ran 28 tests in 1.267s

FAILED (errors=8)
Exception in thread Thread-12 (most likely raised during interpreter shutdown):Exception in thread Thread-13 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
Traceback (most recent call last):

  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 504, in run
  File "/usr/lib/python2.7/threading.py", line 504, in run

  File "/usr/lib/python2.7/SocketServer.py", line 225, in serve_forever  File "/usr/lib/python2.7/SocketServer.py", line 225, in serve_forever
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'select'
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'select'

 Exception in thread Thread-14 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 504, in run
  File "/usr/lib/python2.7/SocketServer.py", line 230, in serve_forever
  File "/usr/lib/python2.7/threading.py", line 388, in setException in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 504, in run
  File "/usr/lib/python2.7/SocketServer.py", line 230, in serve_forever
  File "/usr/lib/python2.7/threading.py", line 388, in set
  File "/usr/lib/python2.7/threading.py", line 295, in notifyAll
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

Alex P-B

unread,
Dec 17, 2013, 12:22:09 PM12/17/13
to jsonr...@googlegroups.com, derric...@gmail.com
I am getting the exact same errors on tests (minus threading errors at the end)
if "client" is the server proxy, it seems calling client.$ANYTHING results in the same error. as does dir(client).
If anyone has any ideas, I'd love to know!

Sergio Orbe

unread,
Jun 5, 2014, 7:54:11 AM6/5/14
to jsonr...@googlegroups.com, derric...@gmail.com
Hi!
I'm running into the same problem... I wonder if this project is currently mantained. There are many unattended issues and pull requests in github.
Reply all
Reply to author
Forward
0 new messages