Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

FileStorage.list() paths are not parsed with default OS-based separator #297

Open
schperplata opened this issue Apr 25, 2022 · 1 comment

Comments

@schperplata
Copy link

I am having issues with pypicloud "Rebuild package list" functionality as it seems that path parser is done always by /, not OS-specific separator, for example \ on windows and / on unix.
Function list() fails on any package rebuild:
image

Traceback (partial):

  File "c:\Users\jurkovicd\Desktop\tmp\pypicloud\pypicloud_venv\lib\site-packages\pypicloud\cache\base.py", line 91, in reload_from_storage
    for pkg in packages:
  File "c:\Users\jurkovicd\Desktop\tmp\pypicloud\pypicloud_venv\lib\site-packages\pypicloud\storage\files.py", line 54, in list
    name, version = shortpath.split("/")
ValueError: not enough values to unpack (expected 2, got 1)

As I am on windows, a quick code change (/ -> \\) fix my problem, and cache is correctly rebuilt.
Is this a bug, or am I doing something wrong?

@stevearc
Copy link
Owner

Looks like a bug! Should be fixed now. Thanks for the report!

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

No branches or pull requests

2 participants