Skip to content

Uninformative error when passing pathlib.Path to pyBigWig.open #163

Description

@rcalef

First, thanks for providing this library to access BigWig files programmatically through Python code!

Description:
I was trying to test out the library using a path stored as a pathilb.Path and it looks like the library doesn't currently support this.

Example:

from pathlib import Path

my_bw_path = Path("/path/to/track.bw")

# Raises the exception:
#  RuntimeError: Received an error during file opening!
bw =  pyBigWig.open(my_bw_path)

# Works fine
my_bw_bw =  pyBigWig.open(str(my_bw_path))

This is an easy fix on the user side, just hard to know that Path vs str is the issue given the error message.

This is with pybigwig==0.3.25.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions