Closed emollier closed 1 year ago
I ran into this as well for #200. I think yours is the correct fix because bgzf.open
would need a file name while the usage here is to re-open an existing file-like object (hence fileobj=
).
Cool, thanks for the confirmation! :)
Thanks for taking the time to provide this fix @emollier. It looks good and I will go ahead and merge.
I've released a new version (v0.7.2) that incorporates these changes. Thanks for helping out!
Starting with version 1.80, biopython does more stringent checks on opening bgzf files. This is causing a series of test failures in pyfaidx 0.7.1:
A full log is available on Debian CI infrastructure, as I first noticed this while attempting to upgrade biopython to version 1.80 in Debian experimental.
Looking at the main development branch, I suspect this breakage might still occur. This patch makes opening bgzf files explicitly in read-only mode, and thus does not trigger the error anymore, without causing regression in the test suite.
Note the comment in BgzfReader constructor mentions that one would:
So maybe this commit is more of a workaround than the proper fix.
Signed-off-by: Étienne Mollier emollier@debian.org