Hi, interesting. This is an example of Python pickling incompatibility. In 0.7 sequence databases were subclasses of dict. In 0.8 they are regular new-style classes (object) + UserDict.DictMixin. As a result we got rid of the __reduce__() method that was necessary when pickling a subclass of dict; 0.8 no longer needs that. The problem is that when unpickling on 0.7 it fails because the object wasn't pickled using __reduce__.
I guess we have the option of adding the __reduce__() method back to 0.8's SequenceDB class, solely for maintaining compatibility with 0.7. Then someday in the future (0.9? 1.0?) we can get rid of it and tell people 0.7 clients are no longer supported by the latest XMLRPC server... How should we proceed? If I add __reduce__() back to a test branch, can you test it by firing it up as a server containing one SequenceFileDB, and see whether an 0.7 client can use that? I guess we could also set up to run nightly 0.7 client tests against our server? This is a clear hole in our current testing strategy -- inter-version incompatibility... -- Chris On Apr 23, 2009, at 4:51 PM, Marek Szuba wrote: > Hi, > > Qi has just run into a problem trying to talk to our XML-RPC server > using Pygr 0.7.1 built against Python 2.4, see the message below. I > have reproduced this behaviour with Python 2.5 so it's beginning to > look as if we introduced an XML-RPC incompatibility between > versions... > Could you have a look? > > > Begin forwarded message: > > Date: Thu, 23 Apr 2009 12:25:20 -0700 > From: wan...@ucla.edu > To: marek.sz...@ucla.edu > Subject: data loading error > > > [wan...@localhost ~]$ python > Python 2.4.3 (#1, Jan 14 2008, 18:31:21) > [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import pygr.Data >>>> hg18=pygr.Data.Bio.Seq.Genome.HUMAN.hg18() > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/usr/lib64/python2.4/site-packages/pygr/Data.py", line 1015, > in __call__ > return getResource(self._path,layer=self._layer,*args,**kwargs) > File "/usr/lib64/python2.4/site-packages/pygr/Data.py", line 671, > in __call__ > obj = db[id] # TRY TO OBTAIN FROM THIS DATABASE > File "/usr/lib64/python2.4/site-packages/pygr/Data.py", line 229, > in __getitem__ > obj = self.finder.loads(objData) > File "/usr/lib64/python2.4/site-packages/pygr/Data.py", line 620, in > loads obj=unpickler.load() # ACTUALLY UNPICKLE THE DATA > File "/usr/lib64/python2.4/pickle.py", line 872, in load > dispatch[key](self) > File "/usr/lib64/python2.4/pickle.py", line 1153, in load_reduce > value = func(*args) > File "/usr/lib64/python2.4/copy_reg.py", line 48, in _reconstructor > obj = object.__new__(cls) > TypeError: object.__new__(XMLRPCSequenceDB) is not safe, use > dict.__new__() >>>> > > > -- > MS --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pygr-dev" group. To post to this group, send email to pygr-dev@googlegroups.com To unsubscribe from this group, send email to pygr-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pygr-dev?hl=en -~----------~----~----~----~------~----~------~--~---