slow5lib
slow5lib copied to clipboard
Double free when using Path instead of str
Hi Hasindu Thank you for the very nice library. I have encountered a segmentation error and others may run into this as well.
from pathlib import Path
import pyslow5
s5_file = Path("runs/random_seqs.slow5")
# does not work:
# free(): invalid pointer
# [1] 19462 IOT instruction python test2.py
# pyslow5.Open(s5_file, 'r')
# fix:
pyslow5.Open(str(s5_file), 'r')
I can provide the slow5 file if needed.
Hello,
The correct api for the input file is a string, not a path object.
So that is working as intended.
James
@Psy-Fer
We could add this information that the input argument to the Open is a string in our documentation?
I thought that given Python is independent of type, data types are converted automatically when needed.