[Biopython-dev] Leaked handles in PAML unit tests

Brandon Invergo b.invergo at gmail.com
Fri Aug 5 13:58:27 UTC 2011


Ok the leaks have been taken care of. The problem arises when an
exception is raised within a block of text in which a file handle is
currently open. I simply had to close the handle just before raising the
exception. There was another one, however, that came up from using
stdout=open('/dev/null', 'w') in the subprocess.call() to PAML programs
(which, come to think of it, is *nix-specific anyway, and probably
wouldn't work with Windows). Instead, I set stdout to a subprocess.PIPE
and get rid of the /dev/null handle altogether.

Cheers,
Brandon


On Thu, 2011-08-04 at 18:32 +0100, Peter Cock wrote:
> On Thu, Aug 4, 2011 at 6:22 PM, Brandon Invergo <b.invergo at gmail.com> wrote:
> >
> > The above does work nicely for me. So nicely, in fact, that the PAML
> > tests all pass! So I'm still having trouble replicating the leaked
> > handles. I'm still trying to figure out what's happening...
> >
> 
> It could be something silly with warning silencing being global
> and not local, and thus depends on the order the tests are run in.
> 
> Did you try running all the (offline) tests in one go under Python 3.2?
> 
> Peter





More information about the Biopython-dev mailing list