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
Comments
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' |
Can’t you check sys.version_info then? |
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. |
BTW:
|
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 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 |
That’s a bad thing. Can you open a bug report about that? We need at least a documentation update. |
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! |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: