ranaroussi / pystore

Fast data store for Pandas time-series data
Apache License 2.0
565 stars 101 forks source link

utils.set_path fails when argument is type pathlib.Path #72

Open gnzsnz opened 5 months ago

gnzsnz commented 5 months ago

utils.set_path fails when argument is type pathlib.Path

File ~/.local/lib/python3.12/site-packages/pystore/utils.py:129, in set_path(path)
    126     path = get_path()
    128 else:
--> 129     path = path.rstrip("/").rstrip("\\").rstrip(" ")
    130     if "://" in path and "file://" not in path:
    131         raise ValueError(
    132             "PyStore currently only works with local file system")

AttributeError: 'PosixPath' object has no attribute 'rstrip'

potential fix

 path = str(path).rstrip("/").rstrip("\\").rstrip(" ")

this should work for both str (coming from os.getenv and pathlib.Path