[Biopython] Problem with Bio.Entrez...

Nathan J. Edwards nje5 at georgetown.edu
Fri Aug 27 04:39:06 UTC 2010


On 8/27/2010 12:13 AM, Nathan J. Edwards wrote:
>
> It would be nice (IWBN) if the parser threw an exception that indicated
> that the returned XML didn't validate...at least then the (very
> cryptic!) error message wouldn't look like a logic error in the parser.

Actually, after wading though the Parser.py code some more, the bad 
element is clearly detected, and an attempt is made to ignore it (the 
empty string), which then subsequently leads to the TypeError exception 
in endElementHandler.

Maybe the test and return of my first email is sufficient to deal with 
the empty strings inserted as part of the "ignore it" strategy.

And, given the frequency with which NCBI seems to break these things, I 
_do_ prefer the "ignore it" strategy, if it works. :-)

Cheers!

- n

-- 
Dr. Nathan Edwards                      nje5 at georgetown.edu
Department of Biochemistry and Molecular & Cellular Biology
            Georgetown University Medical Center
Room 1215, Harris Building          Room 347, Basic Science
3300 Whitehaven St, NW              3900 Reservoir Road, NW
Washington DC 20007                     Washington DC 20007
Phone: 202-687-7042                     Phone: 202-687-1618
Fax: 202-687-0057                         Fax: 202-687-7186



More information about the Biopython mailing list