MaciekAber / pysam

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

segmentation fault when trying to use a closed file #41

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The following code crashes the Python interpreter:
f = Samfile("file.sam", 'r')
f.close()
f.getrname(0)

Of course using a closed file is an error, but it would ease debugging (and 
would have saved me some time) if pysam handled this gracefully.

When attempting the same on built-in file objects, they throw:
"ValueError: I/O operation on closed file"

Original issue reported on code.google.com by marcel.m...@tu-dortmund.de on 15 Sep 2010 at 1:29

GoogleCodeExporter commented 8 years ago
Thanks, this should be changed.

Original comment by andreas....@gmail.com on 7 Oct 2010 at 3:37

GoogleCodeExporter commented 8 years ago
Fixed in branch 0.3 - also added for other methods/attributes.

Bw,
Andreas

Original comment by andreas....@gmail.com on 7 Oct 2010 at 3:54

GoogleCodeExporter commented 8 years ago
Thanks a lot! I can confirm that the small example above indeed does not 
segfault any more.

Original comment by marcel.m...@tu-dortmund.de on 7 Oct 2010 at 4:23