Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gnzsnz opened this issue Jun 4, 2024 · 0 comments
Open

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

gnzsnz opened this issue Jun 4, 2024 · 0 comments

Comments

@gnzsnz
Copy link
Contributor

gnzsnz commented Jun 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant