[Biopython-dev] jython/testing

Peter Cock p.j.a.cock at googlemail.com
Wed Aug 15 07:18:50 EDT 2012


On Tue, Aug 14, 2012 at 9:39 PM, Tiago Antão <tiagoantao at gmail.com> wrote:
> Hi,
>
> I have been trying to use biopython with jython 2.7 alpha 2. Here
> follows a report.
>
>
> There are still a few problems (with SeqIO only):
> test_SeqIO ... ERROR
> test_SeqIO_QualityIO ... FAIL
> test_SeqIO_index ... FAIL
>
> The errors are something like (all the same kind of stuff really):
>
> ...

I see that on my machine too. From looking at the tracebacks and
the associated code, the failures all involve BytesIO (or StringIO
depending on the Python version). Note that BytesIO is new in
Python 2.6, and thus also new in Jython 2.7 compared to Jython 2.5.

This is enough to demonstrate a bug in Jython 2.7a2, which explains
some if not all of our unit test failures:

Expected behaviour:

$ python
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from io import BytesIO
>>> raw = open("Roche/E3MFGYR02_random_10_reads.sff", "rb").read()
>>> raw == BytesIO(raw).read()
True
>>> len(raw)
17592
>>> quit()

Broken behaviour:

$ ~/jython2.7a2/jython
Jython 2.7a2 (default:9c148a201233, May 24 2012, 15:49:00)
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_33
Type "help", "copyright", "credits" or "license" for more information.
>>> from io import BytesIO
>>> raw = open("Roche/E3MFGYR02_random_10_reads.sff", "rb").read()
>>> raw == BytesIO(raw).read()
False
>>> len(raw)
17592
>>> len(BytesIO(raw).read())
51577
>>> BytesIO(raw).read()[:100]
"bytearray(b'.sff\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00A\\xb8\\x00\\x00\\x02\\xfc\\x00\\x00\\x00\\n\\x01\\xb8\\"
>>> raw[:100]
'.sff\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00A\xb8\x00\x00\x02\xfc\x00\x00\x00\n\x01\xb8\x00\x04\x01\x90\x01TACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT'
>>> quit()


I will report this.

Peter



More information about the Biopython-dev mailing list