diff --git a/swh/loader/svn/svn.py b/swh/loader/svn/svn.py --- a/swh/loader/svn/svn.py +++ b/swh/loader/svn/svn.py @@ -43,7 +43,7 @@ def quote_svn_url(url: str) -> str: - return url.replace(" ", "%20") + return url.replace(" ", "%20").replace("#", "%23") class SvnRepo: diff --git a/swh/loader/svn/tests/test_loader.py b/swh/loader/svn/tests/test_loader.py --- a/swh/loader/svn/tests/test_loader.py +++ b/swh/loader/svn/tests/test_loader.py @@ -2175,8 +2175,10 @@ check_snapshot(loader.snapshot, loader.storage) -def test_loader_with_spaces_in_svn_url(swh_storage, repo_url, tmp_path): - filename = "file with spaces.txt" +@pytest.mark.parametrize( + "filename", ["file with spaces.txt", "file#with#hash#signs.txt"] +) +def test_loader_with_special_chars_in_svn_url(repo_url, tmp_path, filename): content = b"foo" add_commit(