[Biopython-dev] Bio.File

Michiel de Hoon mjldehoon at yahoo.com
Tue Oct 18 22:39:53 EDT 2011


Hi Peter,

> That leaves Bio/SCOP/__init__.py as the only existing or
> imminent code using Bio.File, so if we can sort that out,
> we can deprecate Bio.File as you suggested.

In Bio/SCOP/__init__.py, Bio.File.UndoHandle is used in the _open function, which is an internal function used in the "search" function in Bio.SCOP. The UndoHandle is used to wrap a handle returned by urllib.urlopen.

This search function returns a handle to data in HTML format. I don't think we have a parser for it. This suggests that there is no specific purpose for UndoHandle in Bio.SCOP._open.

So I would suggest to just remove the UndoHandle from Bio.SCOP._open and return the urllib.urlopen handle directly.
Any objections?

--Michiel.

--- On Mon, 10/17/11, Peter Cock <p.j.a.cock at googlemail.com> wrote:

> From: Peter Cock <p.j.a.cock at googlemail.com>
> Subject: Re: [Biopython-dev] Bio.File
> To: "Michiel de Hoon" <mjldehoon at yahoo.com>
> Cc: biopython-dev at biopython.org
> Date: Monday, October 17, 2011, 11:03 AM
> Hi Michiel,
> 
> Regarding code using Bio.File, which you asked about
> deprecating last month:
> http://lists.open-bio.org/pipermail/biopython-dev/2011-September/009144.html
> 
> I objected at the time because I was using it for the
> TogoWS code I was working on,
> 
> On Thu, Sep 8, 2011 at 4:25 PM, Peter Cock <p.j.a.cock at googlemail.com>
> wrote:
> On Wed, Sep 7, 2011 at 3:36 PM, Peter Cock <p.j.a.cock at googlemail.com>
> wrote:
> >>> If the server could be relied on to always
> give an
> >>> HTTP error code this wouldn't be needed:
> >>>
> >>> https://github.com/peterjc/biopython/blob/togows/Bio/TogoWS/__init__.py
> >>>
> >
> > ...
> >
> > [Some of those TogoWS checks are probably superfluous
> > right now, I'm still polishing the error handling -
> some of
> > which will rely on TogoWS itself catching more
> conditions]
> 
> I've updated my TogoWS to rely on the HTTP error codes,
> and removed the heuristic error detection which required
> Bio.File for the UndoHandle. That seems to be working fine
> now.
> 
> That leaves Bio/SCOP/__init__.py as the only existing or
> imminent code using Bio.File, so if we can sort that out,
> we can deprecate Bio.File as you suggested.
> 
> Regards,
> 
> Peter
> 


More information about the Biopython-dev mailing list