[Biopython-dev] Test failures on Jython 2.5.1

Eric Talevich eric.talevich at gmail.com
Tue May 18 23:26:33 UTC 2010


On Mon, May 17, 2010 at 12:37 AM, Peter <biopython at maubp.freeserve.co.uk>wrote:

> Hi all (especially Eric),
>
> I've just run the test suite with Jython 2.5.1 and this found some new
> problems. Most of these are XML related from Bio.Phylo
>
> ERROR: Round-trip parsing and serialization of apaf.xml.
> ExpatError: The element type "phy:clade" must be terminated by the
> matching end-tag "</phy:clade>".
>
> ...
>

Fixed in GitHub:
http://github.com/biopython/biopython/commit/ad1a618def838d98432e9623367cffb595eadecd

I couldn't replicate this crash doing anything remotely normal in the Jython
interpreter, but the rewriting scheme in the PhyloXML unit test suite
crashed with various confusing tracebacks. The rewritten files were valid,
though, and could be read by Jython outside the test suite.

I know Jython doesn't clean up file handles as diligently as CPython does,
so my best guess is that some file handles remained open or were
reused/resurrected while parsing the rewritten files -- i.e. during the
second parse, Jython's XML parser either started somplace other than the
start of the file, or terminated early/late, expecting the rewritten file to
have the same size as the original (which it doesn't because of collapsed
whitespace). My patch reworks the file rewriting scheme and manages file
handles obsessively; the PhyloXML parser itself stays the same.

-Eric



More information about the Biopython-dev mailing list