Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix file handle leak in subprocess, but not ideal for Python 2.6 beca…
…use of Python bug http://bugs.python.org/issue5099
- Loading branch information
Showing
2 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
703f7e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes #38. However:
In Python 2.6, because of http://bugs.python.org/issue5099, the
subprocess
module does not behave well when a reference is kept to the process. Specifically, every time a BedTool is destroyed in Python 2.6, you get this error:This seems to be happening because I'm keeping a reference to the process in
BedTool.process
so it can be cleaned up when needed inBedTool.randomintersection()
. This error does not appear in Python 2.7, and it also does not appear if a reference to the process is not stored outside of thehelpers.call_bedtools()
function.Until I figure out a way to solve this in Python 2.6, I'm going to keep as a separate branch for now.