diff --git a/attic/helpers.py b/attic/helpers.py index d749dbd2a..2ad280635 100644 --- a/attic/helpers.py +++ b/attic/helpers.py @@ -412,11 +412,11 @@ class Location: proto = user = host = port = path = archive = None ssh_re = re.compile(r'(?Pssh)://(?:(?P[^@]+)@)?' r'(?P[^:/#]+)(?::(?P\d+))?' - r'(?P[^:]+)(?:::(?P.+))?') + r'(?P[^:]+)(?:::(?P.+))?$') file_re = re.compile(r'(?Pfile)://' - r'(?P[^:]+)(?:::(?P.+))?') + r'(?P[^:]+)(?:::(?P.+))?$') scp_re = re.compile(r'((?:(?P[^@]+)@)?(?P[^:/]+):)?' - r'(?P[^:]+)(?:::(?P.+))?') + r'(?P[^:]+)(?:::(?P.+))?$') def __init__(self, text): self.orig = text diff --git a/attic/testsuite/helpers.py b/attic/testsuite/helpers.py index 5b1d44dc5..e01b652c0 100644 --- a/attic/testsuite/helpers.py +++ b/attic/testsuite/helpers.py @@ -49,6 +49,7 @@ class LocationTestCase(AtticTestCase): 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):