borgbackup / borgstore

experimental storage backend
Other
7 stars 3 forks source link

windows file: URLs #82

Open ThomasWaldmann opened 1 week ago

ThomasWaldmann commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

Conclusion: