[pypy-issue] [issue727] Confusing error/traceback when using Biopython pairwise2

etal tracker at bugs.pypy.org
Tue May 24 01:01:35 CEST 2011


New submission from etal <eric.talevich at gmail.com>:

I'm attempting to make PyPy and Biopython play well together, starting with the
pure-Python portion of Biopython. When using the module Bio.pairwise2, an error
occurs, and the traceback is apparently being clobbered a little bit by some
lower-level issue in PyPy which raises a SystemError.

A simple test script which works in CPython 2.7 is attached. It read a pair of
sequences from a FASTA-format file (using Biopython, successfully) and align
them with Bio.pairwise2 (unsuccessfully in PyPy).

Expected output:

$ python pairwise_simple.py pair.fasta
Score: 99.5
Alignment:
SAEMEDDD-YSKFVKSDMNFDSFELTKSWPEGLKVILK----------------QLLDENNRKNLNFNDLVIHPW
CSDPSKDEIFNEINECEMDLDKCDLTDNWPEGLKAMIKVNGFDYIYIYIYIYIYRLLNFESRKELNLKDIYDDPW


In PyPy:

$ pypy pairwise_simple.py pair.fasta
Traceback (most recent call last):
  File "app_main.py", line 53, in run_toplevel
  File "pairwise_simple.py", line 11, in <module>
    alignments = pairwise2.align.globalds(seq1, seq2, blosum62, -10, -0.5)
  File
"/home/etal/src/pypy-c-jit-43780-b590cf6de419-linux64/site-packages/Bio/pairwise2.py",
line 247, in __call__
    return _align(**keywds)
  File
"/home/etal/src/pypy-c-jit-43780-b590cf6de419-linux64/site-packages/Bio/pairwise2.py",
line 268, in _align
    score_only)
SystemError: An exception was set, but function returned a value


The code for Bio.pairwise2 is here:
https://github.com/biopython/biopython/blob/master/Bio/pairwise2.py

Notice that the "align.globalds" method is created on the fly. The "traceback"
variable refers to part of the dynamic programming algorithm being implemented,
not the Python exception mechanism.


My test data file, pair.fasta, looks like this:

>A
SAEMEDDDYSKFVKSDMNFDSFELTKSWPEGLKVILKQLLDENNRKNLNFNDLVIHPW
>B
CSDPSKDEIFNEINECEMDLDKCDLTDNWPEGLKAMIKVNGFDYIYIYIYIYIYRLLNFESRKELNLKDIYDDPW

----------
files: pairwise_simple.py
messages: 2533
nosy: etal, pypy-issue
priority: bug
release: 1.5
status: unread
title: Confusing error/traceback when using Biopython pairwise2

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue727>
________________________________________


More information about the pypy-issue mailing list