diff --git a/material/plugins/privacy/plugin.py b/material/plugins/privacy/plugin.py index 6a674ea53be..e6a87203e48 100644 --- a/material/plugins/privacy/plugin.py +++ b/material/plugins/privacy/plugin.py @@ -37,7 +37,7 @@ from mkdocs.structure.files import File, Files from mkdocs.utils import is_error_template from re import Match -from urllib.parse import ParseResult as URL, urlparse +from urllib.parse import ParseResult as URL, urlparse, unquote from xml.etree.ElementTree import Element, tostring from .config import PrivacyConfig @@ -515,7 +515,7 @@ def _path_from_url(self, url: URL): # Create a file for the given path def _path_to_file(self, path: str, config: MkDocsConfig): return File( - posixpath.join(self.config.assets_fetch_dir, path), + posixpath.join(self.config.assets_fetch_dir, unquote(path)), os.path.abspath(self.config.cache_dir), config.site_dir, False diff --git a/src/plugins/privacy/plugin.py b/src/plugins/privacy/plugin.py index 6a674ea53be..e6a87203e48 100644 --- a/src/plugins/privacy/plugin.py +++ b/src/plugins/privacy/plugin.py @@ -37,7 +37,7 @@ from mkdocs.structure.files import File, Files from mkdocs.utils import is_error_template from re import Match -from urllib.parse import ParseResult as URL, urlparse +from urllib.parse import ParseResult as URL, urlparse, unquote from xml.etree.ElementTree import Element, tostring from .config import PrivacyConfig @@ -515,7 +515,7 @@ def _path_from_url(self, url: URL): # Create a file for the given path def _path_to_file(self, path: str, config: MkDocsConfig): return File( - posixpath.join(self.config.assets_fetch_dir, path), + posixpath.join(self.config.assets_fetch_dir, unquote(path)), os.path.abspath(self.config.cache_dir), config.site_dir, False