quachtina96 / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

_samtools_dispatch() does not clean up tempfiles properly #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Count the number of empty tmpfiles in /tmp/ with e.g. "find /tmp/ -name 
'tmp*' -type f -empty 2> /dev/null | wc -l"

2. Run the following snippet:
import pysam
fafile = "/my/fastafile/directory/hg19.fa"
region = "chr19:100000-100200"
_ = pysam.faidx(fafile, region)

3. The number of empty tmpfiles in /tmp/ has increased by one (see command in 
(1))

What is the expected output? What do you see instead?
Using pysam.faidx() (and probably other dispatch commands) litters tempfiles. 
The tempfiles should be cleaned up.

What version of the product are you using? On what operating system?
pysam 0.7.4 with python 2.7.3 on linux/x86_64

Please provide any additional information below.
I pinpointed the offending function to be _samtools_dispatch() in 
csamtools.pyx. Applying the modifications in the patch in the attachment and 
rebuilding pysam solved the issue for me.

Original issue reported on code.google.com by K.Rooij...@gmail.com on 21 Jun 2013 at 1:55

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks! I have added your change to the code.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 26 Jun 2013 at 7:26