MaciekAber / pysam

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

Opening sam as bam segfaults on fetch() #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. samfile = pysam.Samfile('ex1.sam', 'rb') #note rb/sam conflicc
2. samfile.fetch('chr1', 0, 100)

What is the expected output? What do you see instead?
Should raise an exception (ValueError, 'Magic BAM mark missing at the beginning 
of %filename%, not a valid BAM file).

It segfaults instead.

What version of the product are you using? On what operating system?
129:4138673c1a3d,  Ubuntu 10.4

Please provide any additional information below.
Attached patch for the segfault_tests.

Original issue reported on code.google.com by finkerna...@mathematik.uni-marburg.de on 18 Oct 2010 at 2:31

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, fixed, opening file in the wrong format now raises ValueError.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 2 Nov 2010 at 8:26