MaciekAber / pysam

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

accessing a closed samfile causes segmentation fault #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
python
import pysam
samfile = pysam.Samfile( "ex1.bam", "rb" )
for alignedread in samfile.fetch('chr1', 100, 120):
     print alignedread

samfile.close()
for alignedread in samfile.fetch('chr1', 100, 120):
     print alignedread

What is the expected output? 
should throw exception for trying to use a closed file.
"ValueError: I/O operation on closed file"                                      

like python files

What do you see instead?
... ... Segmentation fault                                                      

Please use labels and text to provide additional information.

Original issue reported on code.google.com by martingo...@gmail.com on 14 Oct 2009 at 3:34

GoogleCodeExporter commented 8 years ago
fixed in version 0.2.

Accessing a closed samfile will now raise a ValueError

Original comment by andreas....@gmail.com on 4 May 2010 at 4:32