[Biopython] Entrez and SeqIO "no records found in handle"

Peter Cock p.j.a.cock at googlemail.com
Wed Mar 7 17:32:57 UTC 2012


On Wed, Mar 7, 2012 at 5:22 PM, A M Torres, Hugo
<mnemonico at posthocergopropterhoc.net> wrote:
> Hi Peter.
>
> More specificaly for instance,
>
> handle = Entrez.efetch(db='nucleotide',
>                            rettype='gb',
>                            retmode='xml',
>                            id=gene)
> record = SeqIO.read(handle, 'gb')
> handle.close()
>
> ====================================================
> ...
ValueError: No records found in handle

Hi Hugo,

Getting an error here is good - there were no GenBank formatted records
in your file (while there should have been an XML record). Perhaps if
we expect this to be a common error a more specific exception would
be nicer? e.g. ValueError("This is XML, not GenBank plain text")

Maybe I don't understand what you are querying?

Peter




More information about the Biopython mailing list