Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmlrpclib.__version__ not bumped with updates #57121

Closed
rcritten mannequin opened this issue Sep 6, 2011 · 7 comments
Closed

xmlrpclib.__version__ not bumped with updates #57121

rcritten mannequin opened this issue Sep 6, 2011 · 7 comments
Labels
stdlib Python modules in the Lib dir

Comments

@rcritten
Copy link
Mannequin

rcritten mannequin commented Sep 6, 2011

BPO 12912
Nosy @birkenfeld, @benjaminp, @merwok, @berkerpeksag

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-01-29.07:51:18.881>
created_at = <Date 2011-09-06.13:41:44.139>
labels = ['library']
title = 'xmlrpclib.__version__ not bumped with updates'
updated_at = <Date 2016-01-29.07:51:18.879>
user = 'https://bugs.python.org/rcritten'

bugs.python.org fields:

activity = <Date 2016-01-29.07:51:18.879>
actor = 'berker.peksag'
assignee = 'none'
closed = True
closed_date = <Date 2016-01-29.07:51:18.881>
closer = 'berker.peksag'
components = ['Library (Lib)']
creation = <Date 2011-09-06.13:41:44.139>
creator = 'rcritten'
dependencies = []
files = []
hgrepos = []
issue_num = 12912
keywords = []
message_count = 7.0
messages = ['143604', '143624', '143638', '143641', '143643', '143676', '259197']
nosy_count = 5.0
nosy_names = ['georg.brandl', 'benjamin.peterson', 'eric.araujo', 'berker.peksag', 'rcritten']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue12912'
versions = ['Python 3.3']

@rcritten
Copy link
Mannequin Author

rcritten mannequin commented Sep 6, 2011

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'

@rcritten rcritten mannequin added the stdlib Python modules in the Lib dir label Sep 6, 2011
@merwok
Copy link
Member

merwok commented Sep 6, 2011

The 2.7 xmlrpclib is not completely backward compatible with that in 2.6

Can’t you check sys.version_info then?

@rcritten
Copy link
Mannequin Author

rcritten mannequin commented Sep 6, 2011

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.

@merwok
Copy link
Member

merwok commented Sep 6, 2011

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.

@rcritten
Copy link
Mannequin Author

rcritten mannequin commented Sep 6, 2011

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

@merwok
Copy link
Member

merwok commented Sep 7, 2011

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.

@berkerpeksag
Copy link
Member

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!

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

3 participants