classification
Title: xmlrpclib.__version__ not bumped with updates
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, berker.peksag, eric.araujo, georg.brandl, rcritten
Priority: normal Keywords:

Created on 2011-09-06 13:41 by rcritten, last changed 2016-01-29 07:51 by berker.peksag. This issue is now closed.

Messages (7)
msg143604 - (view) Author: Rob Crittenden (rcritten) Date: 2011-09-06 13:41
xmlrpclib.__version__ reports 1.0.1 from Python 2.7 in Fedora 14 and Python 2.6 in Fedora 12.

I discovered this while trying to find a way to identify the version of xmlrpclib. The 2.7 xmlrpclib is not completely backward compatible with that in 2.6

Version-Release number of selected component (if applicable):

python-2.7-7.fc14.x86_64

Steps to Reproduce:

$ rpm -q python
python-2.6.2-8.fc12.x86_64
$ python
Python 2.6.2 (r262:71600, Jun  4 2010, 18:28:58) 
[GCC 4.4.3 20100127 (Red Hat 4.4.3-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> xmlrpclib.__version__
'1.0.1'

$ rpm -q python
python-2.7-7.fc14.x86_64
$ python
Python 2.7 (r27:82500, Jul 26 2010, 18:19:48) 
[GCC 4.5.0 20100716 (Red Hat 4.5.0-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> xmlrpclib.__version__
'1.0.1'
msg143624 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-06 16:19
> The 2.7 xmlrpclib is not completely backward compatible with that in 2.6

Can’t you check sys.version_info then?
msg143638 - (view) Author: Rob Crittenden (rcritten) Date: 2011-09-06 17:58
Yes, this is the solution I ended up using as a workaround.

I figured that since xmlrpclib has its own version it should be meaningful.
msg143641 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-06 18:05
> I figured that since xmlrpclib has its own version it should be meaningful.
That was most probably the intent of the attribute, but it seems to have become unmaintained.  In any case, a change could not be done in a 2.7 bugfix release.  Maybe it’s worth changing it in 3.3, or it could just be removed.

BTW:
> The 2.7 xmlrpclib is not completely backward compatible with that in 2.6
Do you mean that your code relied on bugs or undocumented behavior, or that you’ve found regressions?  If it’s the later, please report bugs.
msg143643 - (view) Author: Rob Crittenden (rcritten) Date: 2011-09-06 18:35
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
msg143676 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-07 14:15
> Unfortunately that update changed the interface of
> Transport.make_connection(), breaking any code that overrode or
> extended it.

That’s a bad thing.  Can you open a bug report about that?  We need at least a documentation update.
msg259197 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-01-29 07:51
xmlrpc.client.__version__ is used by Transport.user_agent and it has been changed to use sys.version[:3] in 197d703fb23e. It's too late for 2.7 so I think this can be closed now.

Thanks for the report, Rob!
History
Date User Action Args
2016-01-29 07:51:18berker.peksagsetstatus: pending -> closed

nosy: + berker.peksag
messages: + msg259197

resolution: out of date
stage: resolved
2016-01-20 10:04:14serhiy.storchakasetstatus: open -> pending
2011-09-07 14:15:38eric.araujosetmessages: + msg143676
2011-09-06 18:35:42rcrittensetmessages: + msg143643
2011-09-06 18:05:58eric.araujosetnosy: + georg.brandl, benjamin.peterson

messages: + msg143641
versions: + Python 3.3, - Python 2.7
2011-09-06 17:58:09rcrittensetmessages: + msg143638
2011-09-06 16:19:45eric.araujosetnosy: + eric.araujo
messages: + msg143624
2011-09-06 13:41:44rcrittencreate