joshmarshall / jsonrpclib

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

AttributeError: 'SafeTransport' object has no attribute 'context' #34

Closed vimalloc closed 8 years ago

vimalloc commented 9 years ago

I'm running into an error when running this code on python 2.7.9

import jsonrpclib
server = jsonrpclib.Server('https://<ip_addr>:<port>')
print server.foo()

And get the following stacktrace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lgbland/code/xmsso/venv/lib/python2.7/site-packages/jsonrpclib/jsonrpc.py", line 274, in __call__
    return self.__send(self.__name, args)
  File "/home/lgbland/code/xmsso/venv/lib/python2.7/site-packages/jsonrpclib/jsonrpc.py", line 224, in _request
    response = self._run_request(request)
  File "/home/lgbland/code/xmsso/venv/lib/python2.7/site-packages/jsonrpclib/jsonrpc.py", line 242, in _run_request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1293, in single_request
    h = self.make_connection(host)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1509, in make_connection
    self._connection = host, HTTPS(chost, None, context=self.context, **(x509 or {}))
AttributeError: 'SafeTransport' object has no attribute 'context'

The same code works fine in python 2.7.6. Some underlying change in xmlrpclib perhaps?

cappy123abc commented 9 years ago

I've got he same problem.

cappy123abc commented 9 years ago

Release notes for 2.7.9

+++++++++++ Python News +++++++++++

What's New in Python 2.7.9?

Release date: 2014-12-10

Library

msabramo commented 8 years ago

It looks like this issue was fixed by https://github.com/joshmarshall/jsonrpclib/pull/36 and the fix is present in jsonrpclib 0.1.7 on PyPI.

I think this issue can be closed.