[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

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)
line 247, in __call__
    return _align(**keywds)
line 268, in _align
SystemError: An exception was set, but function returned a value

The code for Bio.pairwise2 is here:

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:


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>

More information about the pypy-issue mailing list