Skip to content
This repository was 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

Description

@schperplata

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions