Upgrading standard library module

B

Bryan

I have a Python v2.5.2 server running and I found some undesirable
behavior in the xmlrpclib module that is included with that version of
Python. The xmlrpclib version that is included with Python 2.6
changes the behavior for the better. I nervous about upgrading my
Python install to 2.6 on this server because I remember reading in the
docs of a library I use that it targets the 2.5 branch. What is the
best way to only upgrade the xmlrpclib in my 2.5 install?

Also, have you all had problems with libraries not specifying which
Python version they target? I can't find a requirements for the
formencode library. It is kind of scary upgrading my Python server
install without being sure all my libraries will work. Experiences??

Bryan
 
M

Mike Driscoll

I have a Python v2.5.2 server running and I found some undesirable
behavior in the xmlrpclib module that is included with that version of
Python.  The xmlrpclib version that is included with Python 2.6
changes the behavior for the better.  I nervous about upgrading my
Python install to 2.6 on this server because I remember reading in the
docs of a library I use that it targets the 2.5 branch.  What is the
best way to only upgrade the xmlrpclib in my 2.5 install?

Also, have you all had problems with libraries not specifying which
Python version they target?  I can't find a requirements for the
formencode library.  It is kind of scary upgrading my Python server
install without being sure all my libraries will work.  Experiences??

Bryan

Well, you could put your current install in a virtualenv and then try
the new version of Python 2.6 in another virtualenv. See
http://pypi.python.org/pypi/virtualenv for more info.

As long as your 3rd party packages are pure python, you should be ok.
If they depend on c/c++ headers, then you may have issues.

Mike
 
J

Jason Scheirer

I have a Python v2.5.2 server running and I found some undesirable
behavior in the xmlrpclib module that is included with that version of
Python.  The xmlrpclib version that is included with Python 2.6
changes the behavior for the better.  I nervous about upgrading my
Python install to 2.6 on this server because I remember reading in the
docs of a library I use that it targets the 2.5 branch.  What is the
best way to only upgrade the xmlrpclib in my 2.5 install?

Also, have you all had problems with libraries not specifying which
Python version they target?  I can't find a requirements for the
formencode library.  It is kind of scary upgrading my Python server
install without being sure all my libraries will work.  Experiences??

Bryan

Python has always been pretty backwards-compatible and has a nice
roadmap for upgrades (with new languages features living in __future__
for a version or so before they're in the main version). With the
exception of 2.X->3, you can usually assume that any pure-Python
modules written for 2.x will work in 2.(x+1), and assuming they don't
issue any warnings, also in 2.(x+2).

What behavior, exactly, do you not like in xmlrpclib? Diffing the 2.5
and 2.6, only significant differences I see are checks for True/False
as builtins left over from pre-2.4 and some datetime handling.
 
B

Bryan

Python has always been pretty backwards-compatible and has a nice
roadmap for upgrades (with new languages features living in __future__
for a version or so before they're in the main version). With the
exception of 2.X->3, you can usually assume that any pure-Python
modules written for 2.x will work in 2.(x+1), and assuming they don't
issue any warnings, also in 2.(x+2).

What behavior, exactly, do you not like in xmlrpclib? Diffing the 2.5
and 2.6, only significant differences I see are checks for True/False
as builtins left over from pre-2.4 and some datetime handling.

The xmlrpclib in my 2.5.2 install does not allow the marshaling of my
custom objects. It checks the type of my object, and if it isn't in a
hard-coded list of types, then a "Cannot marshal object of <type>
type" exception message shows up. The version in my Windows 2.6
install has a fall back case where if the type is not in the hard-
coded list, it simply calls Object.__dict__ to get a graph of the
object's values that can be marshaled into xmlrpc.

I am using xmlrpc through Pylons. As a workaround, instead of
returning my custom objects in my xmlrpc server functions, I return
MyObject.__dict__

I also did not see anything in the revision log in the source file
about this change.
 
G

Gabriel Genellina

The xmlrpclib in my 2.5.2 install does not allow the marshaling of my
custom objects. It checks the type of my object, and if it isn't in a
hard-coded list of types, then a "Cannot marshal object of <type>
type" exception message shows up. The version in my Windows 2.6
install has a fall back case where if the type is not in the hard-
coded list, it simply calls Object.__dict__ to get a graph of the
object's values that can be marshaled into xmlrpc.

I am using xmlrpc through Pylons. As a workaround, instead of
returning my custom objects in my xmlrpc server functions, I return
MyObject.__dict__

I also did not see anything in the revision log in the source file
about this change.

It was rev.52790: http://svn.python.org/view?rev=52790&view=rev
The tracker item has some background: http://bugs.python.org/issue1070046
 
G

Gabriel Genellina

Can you give me a quick run down of your process for researching this
information? I don't spend much time looking at the svn or bug
tracker.

First, I looked the section in xmlrpclib.py that you were refering to.
Then, over a checked out copy of the sources, I ran:
svn blame xmlrpclib.py
and I got the revision those lines were last modified. Then from the log
message of rev. 52790 I got the reference to the tracker item.
Should I be checking there before posting?

It's a good idea to check first, but don't refrain from posting here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top