[issue12912] xmlrpclib.__version__ not bumped with updates

Rob Crittenden report at bugs.python.org
Tue Sep 6 20:35:46 CEST 2011


Rob Crittenden <rcritten at redhat.com> added the comment:

Python 2.7 changed the internal class used in xmlrpclib from HTTP to HTTPConnection. 

I have code that subclasses httplib.HTTP to use the python-nss package to create a connection over SSL (similiar to httplib.HTTPS). My code currently looks something like this as a workaround:

class NSSConnection(httplib.HTTPConnection)
...

class NSSHTTPS(httplib.HTTP):
    _connection_class = NSSConnection

    def __init__ ...

def connect():
    (major, minor, micro, releaselevel, serial) = sys.version_info
    if major == 2 and minor < 7:
        conn = NSSHTTPS(host, 443, dbdir="/etc/pki/nssdb")
    else:
        conn = NSSConnection(host, 443, dbdir="/etc/pki/nssdb")

Full code is at https://fedorahosted.org/freeipa/browser/ipalib/rpc.py and https://fedorahosted.org/freeipa/browser/ipapython/nsslib.py

At least one other person has run into this, https://techknowhow.library.emory.edu/blogs/branker/2011/07/01/python-27-xmlrpclibtransport-backward-compatibility

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12912>
_______________________________________


More information about the Python-bugs-list mailing list