MaciekAber / pysam

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

Fetch() on a in 'non binary' mode opened binary file crashes python #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.import pysam
2.>>> p = pysam.Samfile('somefile.bam','r')
3.>>> p.fetch().next()
import pysam

What is the expected output? What do you see instead?
Expected: Regular exception, ValueError or such.
Actualy:
[samopen] no @SQ lines in the header.

[sam_read1] missing header? Abort!
(Python process gone)

What version of the product are you using? On what operating system?
Revision 72 Ubuntu.

Please provide any additional information below.

Original issue reported on code.google.com by finkerna...@mathematik.uni-marburg.de on 28 Oct 2009 at 10:40

GoogleCodeExporter commented 8 years ago
This is a problem in the samtools sam_read1 function:

if (header->n_targets == 0) {                                                   

                                fprintf(stderr, "[sam_read1] missing header?
Abort!\n");                                                                     

    exit(1);
}

I don't know how to catch this. Best would be to change this in samtools.

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

GoogleCodeExporter commented 8 years ago

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

GoogleCodeExporter commented 8 years ago

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

GoogleCodeExporter commented 8 years ago
fixed in version 0.3

Original comment by andreas....@gmail.com on 23 Jul 2010 at 10:01