[Biopython-dev] (no subject)

Antonio Cavallo a.cavallo at reading.ac.uk
Wed Feb 11 12:20:04 EST 2004



On Wed, 11 Feb 2004, Jeffrey Chang wrote:

Now it seems ok: in effect I'm running on an un-usual
layout (but very updated so when do you need a beta tester
I'm here).
thank you very much,
antonio



> Hi Antonio,
> 
> I think I see what's going on.  Are you using Python 2.3?  It looks  
> like Python 2.3 has changed the behavior of operator.isMappingType with  
> respect to lists.  In Python2.2, it returns 0, and in Python 2.3, it  
> returns true.
> 
> The code in Bio/config/DBRegistry.py expects lists to not be a mapping  
> type, which causes problems.  The fix is to change the following code  
> in that file:
>      if operator.isMappingType(params):
>          params = params.items()
> to:
>      if operator.isMappingType(params) and hasattr(params, "items"):
>          params = params.items()
> 
> I've made this change, and your code is working again.
> 
> I've updated this in the CVS, and it will propogate to the anonymous  
> CVS in a few hours.  Please let me know if there are further problems.
> 
> Jeff
> 
> 
> 
> 
> On Feb 11, 2004, at 8:02 AM, Antonio Cavallo wrote:
> 
> >
> > Hy,
> >
> > there is my problem.
> > I would like to retrieve some accessions from embl data source, and  
> > I've
> > read the tutorial so:
> >
> > ======================================================================= 
> > ===========
> >>>> from Bio import db
> >>>> sp = db["embl"]
> >>>> record_handle = sp['AA054823']
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 152, in __getitem__
> >     data = self._run_serial(key)
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 219, in _run_serial
> >     raise KeyError, "I could not get any results."
> > KeyError: 'I could not get any results.'
> > ======================================================================= 
> > ===========
> >
> >
> > This error seems strange because that entry does exist!
> > Using other sources:
> >
> >
> > ======================================================================= 
> > ===========
> >>>> sp = db['embl-dbfetch-cgi']
> >>>> record_handle = sp['AA054823']
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 89, in __getitem__
> >     return self._get(key)
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > _support.py",
> > line 109, in __call__
> >     return self.fn(*args, **keywds)
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 267, in _get
> >     handle = self._cgiopen(key)
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 274, in _cgiopen
> >     options = _my_urlencode(params)
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 561, in _my_urlencode
> >     params = params.items()
> > AttributeError: 'list' object has no attribute 'items'
> > ======================================================================= 
> > ===========
> >
> > And more:
> >
> > ======================================================================= 
> > ===========
> >>>> sp = db['embl-fast']
> >>>> record_handle = sp['AA054823']
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 150, in __getitem__
> >     data = self._run_concurrent(key)
> >   File
> > "/home/users/antonio/usr/encap/biopython-1.23/lib/python/Bio/config/ 
> > DBRegistry.py",
> > line 202, in _run_concurrent
> >     raise KeyError, "I could not get any results."
> > KeyError: 'I could not get any results.'
> >>>>
> > ======================================================================= 
> > ===========
> >
> >
> >
> >
> > What's wrong? After installing the biopython-1.23 there is something  
> > else
> > I have to do in order to get access to the embl database?
> > Sorry but I'm totally new to biopython.
> > Thank you in advance,
> > antonio
> > _______________________________________________
> > Biopython-dev mailing list
> > Biopython-dev at biopython.org
> > http://biopython.org/mailman/listinfo/biopython-dev
> 
> 



More information about the Biopython-dev mailing list