pystore icon indicating copy to clipboard operation
pystore copied to clipboard

utils.set_path fails when argument is type pathlib.Path

Open gnzsnz opened this issue 8 months ago • 0 comments

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

gnzsnz avatar Jun 04 '24 18:06 gnzsnz