[Biopython-dev] [Bug 2454] New: Iterators can't use file-like objects

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Feb 20 14:41:38 EST 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2454

           Summary: Iterators can't use file-like objects
           Product: Biopython
           Version: 1.43
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: cracka80 at gmail.com


I've noticed, when using BioPython, that if I hold my data in a StringIO object
then several iterators cannot parse the data, due to type checking. Rather than
check to see if the object has particular methods/attributes, they check its
class, which will only validate if the object is an actual file instance, and
invalidates perfectly valid file-like objects like StringIOs and URLs.

I've so far only experienced it in version 1.43, but this is the latest version
available from the Ubuntu package repository, so there may be many users
experiencing the same problem.

The affected iterators/functions are:
   * Gobase.Iterator
   * SwissProt.SProt.Iterator
   * Medline.Iterator
   * Prosite.Iterator
   * Prosite.Prodoc.Iterator
   * Rebase.Iterator
   * SCOP.Hie.Iterator
   * SCOP.Cla.Iterator
   * SCOP.Dom.Iterator
   * SCOP.Des.Iterator
   * SCOP.Raf.Iterator
   * Sequencing.Phd.Iterator
   * Sequencing.Ace.Iterator
   * SwissProt.KeyWList.extract_keywords

A possible solution might be to implement a function which checks if an object
is file-like; i.e. has all the necessary attributes and functions to be used as
a file, and replace the type-checking with the application of this function to
the object.


-- 
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