[Biopython-dev] [Bug 2938] New: Bio.Entrez.read() returns empty string for HTML (not an error)

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Oct 27 15:50:03 UTC 2009


           Summary: Bio.Entrez.read() returns empty string for HTML (not an
           Product: Biopython
           Version: 1.52
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: biopython-bugzilla at maubp.freeserve.co.uk

If given HTML instead of XML, Bio.Entrez.read() returns an empty string. I
would have expected a helpful error message.


>>> from Bio import Entrez
>>> handle = Entrez.efetch(db="pubmed", id="17206916")
>>> handle.readline()
'<html><head><title>PmFetch response</title></head><body>\n'

Try parsing this HTML as if it were XML ...

>>> handle = Entrez.efetch(db="pubmed", id="17206916")
>>> "" == Entrez.read(handle)

i.e. Entrez.read is returning an empty string.

Problem spotted based on a mailing list query, see this thread:

Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Biopython-dev mailing list