mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 16:55:36 +00:00
Fix minor location parser bug.
Make sure the entire input is parsed.
This commit is contained in:
parent
9f64e39d9f
commit
21e03af56b
2 changed files with 4 additions and 3 deletions
|
@ -412,11 +412,11 @@ class Location:
|
|||
proto = user = host = port = path = archive = None
|
||||
ssh_re = re.compile(r'(?P<proto>ssh)://(?:(?P<user>[^@]+)@)?'
|
||||
r'(?P<host>[^:/#]+)(?::(?P<port>\d+))?'
|
||||
r'(?P<path>[^:]+)(?:::(?P<archive>.+))?')
|
||||
r'(?P<path>[^:]+)(?:::(?P<archive>.+))?$')
|
||||
file_re = re.compile(r'(?P<proto>file)://'
|
||||
r'(?P<path>[^:]+)(?:::(?P<archive>.+))?')
|
||||
r'(?P<path>[^:]+)(?:::(?P<archive>.+))?$')
|
||||
scp_re = re.compile(r'((?:(?P<user>[^@]+)@)?(?P<host>[^:/]+):)?'
|
||||
r'(?P<path>[^:]+)(?:::(?P<archive>.+))?')
|
||||
r'(?P<path>[^:]+)(?:::(?P<archive>.+))?$')
|
||||
|
||||
def __init__(self, text):
|
||||
self.orig = text
|
||||
|
|
|
@ -49,6 +49,7 @@ def test(self):
|
|||
repr(Location('some/relative/path::archive')),
|
||||
"Location(proto='file', user=None, host=None, port=None, path='some/relative/path', archive='archive')"
|
||||
)
|
||||
self.assert_raises(ValueError, lambda: Location('ssh://localhost:22/path:archive'))
|
||||
|
||||
|
||||
class FormatTimedeltaTestCase(AtticTestCase):
|
||||
|
|
Loading…
Reference in a new issue