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

windows file: URLs #82

Open
ThomasWaldmann opened this issue Oct 15, 2024 · 3 comments
Open

windows file: URLs #82

ThomasWaldmann opened this issue Oct 15, 2024 · 3 comments
Milestone

Comments

@ThomasWaldmann
Copy link
Member

Looks like Windows compatibility got broken with borgstore 0.1.0 (or recent borg changes):

self = <[AttributeError("'Store' object has no attribute 'levels'") raised in repr()] Store object at 0x2072b4d2a10>
url = 'file://D:/a/_temp/msys64/tmp/pytest-of-runneradmin/pytest-0/popen-gw1/test_create_topical_archiver_0/repository'
backend = None
levels = {'archives/': [0], 'cache/': [0], 'config/': [0], 'data/': [0], ...}

    def __init__(self, url: Optional[str] = None, backend: Optional[BackendBase] = None, levels: Optional[dict] = None):
        self.url = url
        if backend is None and url is not None:
            backend = get_backend(url)
            if backend is None:
>               raise BackendURLInvalid(f"Invalid Backend Storage URL: {url}")
E               borgstore.backends.errors.BackendURLInvalid: Invalid Backend Storage URL: file://D:/a/_temp/msys64/tmp/pytest-of-runneradmin/pytest-0/popen-gw1/test_create_topical_archiver_0/repository

Also, there seems to be an issue with Store.levels initialization, see first line.

@ThomasWaldmann
Copy link
Member Author

Guess borgstore < 0.1.0 accepted these because it accepted file:// + a relative path (did not require a leading slash and basically accepted everything).

@ThomasWaldmann
Copy link
Member Author

WP says: https://en.wikipedia.org/wiki/File_URI_scheme

file:///c:/WINDOWS/clock.avi

So, it's triple-slash + full windows path with drive letter.

Slightly inconsistent with POSIX systems, where the third slash is already part of the full path.

@ThomasWaldmann
Copy link
Member Author

Conclusion:

  • keep regex in borgstore as is
  • when running on windows, borgstore needs to lstrip "file:///" to create the full store path.
  • when running on something else, borgstore needs to lstrip "file://" to create the full store 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