[Biopython-dev] [Bug 2804] New: Clustalw subprocess hangs when large stdout returned

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Apr 1 18:04:05 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2804

           Summary: Clustalw subprocess hangs when large stdout returned
           Product: Biopython
           Version: Not Applicable
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: cymon.cox at gmail.com


As noted on the mailing list, the following hangs waiting for a return:

from Bio import SeqIO
from Bio import Clustalw
from Bio.Clustalw import MultipleAlignCL

records = list(SeqIO.parse(open("Tests/NBRF/Cw_prot.pir", "r"), "pir"))
handle = open("temp.fasta", "w")
SeqIO.write(records, handle, "fasta")
handle.close()
cline = MultipleAlignCL("temp.fasta", command="clustalw")
align = Clustalw.do_alignment(cline)

This appears to be due to a known issue as documented here:
http://docs.python.org/library/subprocess.html#subprocess.Popen.wait
but wasnt being picked up by the tests - presumably because no test file is
large enough to trigger the problem.

Instead of using .wait() it suggests .communicate()

The attached patch works for me on Linux. But as noted in __init__.py this
maybe an issue for Windows:
        #We don't need to supply any piped input, but we setup the
        #standard input pipe anyway as a work around for a python
        #bug if this is called from a Windows GUI program.  For
        #details, see http://bugs.python.org/issue1124861

Also subprocess.returncode is now /3 so moved "if status: value = status / 256
"so that only done if calling os.popen()

C.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list