diff --git a/aptly_api/parts/publish.py b/aptly_api/parts/publish.py index 6891396..c6c3af9 100644 --- a/aptly_api/parts/publish.py +++ b/aptly_api/parts/publish.py @@ -40,6 +40,8 @@ def endpoint_from_response(api_response: Union[Dict[str, str], Dict[str, List[st @staticmethod def escape_prefix(prefix: str) -> str: + if prefix == ".": + return ":." if "/" in prefix: # prefix has not yet been quoted as described at # https://www.aptly.info/doc/api/publish/ diff --git a/aptly_api/tests/publish.py b/aptly_api/tests/publish.py index 4385f46..b9dc8b6 100644 --- a/aptly_api/tests/publish.py +++ b/aptly_api/tests/publish.py @@ -281,3 +281,7 @@ def test_escape_prefix(self, *args: Any, **kwargs: Any) -> None: self.papi.escape_prefix("test/a"), "test_a" ) + self.assertEqual( + self.papi.escape_prefix("."), + ":." + )