-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open
Description
Contribution guidelines
- I've read the contribution guidelines and wholeheartedly agree
I've found a bug and checked that ...
- ... the problem doesn't occur with the
mkdocsorreadthedocsthemes - ... the problem persists when all overrides are removed, i.e.
custom_dir,extra_javascriptandextra_css - ... the documentation does not mention anything about my problem
- ... there are no open or closed issues that are related to my problem
Description
When the privacy plugin is enabled and the site_url parameter isn't set, building the project fails.
To reproduce, create a minimal MkDocs project using the mkdocs.yml below.
Error message:
Traceback (most recent call last):
File "/opt/homebrew/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/mkdocs/__main__.py", line 250, in build_command
build.build(cfg, dirty=not clean)
File "/opt/homebrew/lib/python3.10/site-packages/mkdocs/commands/build.py", line 332, in build
config.plugins.run_event('post_build', config=config)
File "/opt/homebrew/lib/python3.10/site-packages/mkdocs/plugins.py", line 519, in run_event
result = method(**kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/material/plugins/privacy/plugin.py", line 187, in on_post_build
self._fetch_dependents(f.read(), file, config),
File "/opt/homebrew/lib/python3.10/site-packages/material/plugins/privacy/plugin.py", line 335, in _fetch_dependents
url = posixpath.join(config.site_url, file.url)
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/posixpath.py", line 76, in join
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneTypeExpected behaviour
We should be able to build a project even when the site_url parameter is omitted, i.e., is null.
Actual behaviour
See description.
Steps to reproduce
See description.
Package versions
- Python: 3.10.8
- MkDocs: 1.4.1
- Material: mkdocs-material-8.5.6-insiders-4.26.0
Configuration
site_name: Test Project
theme:
name: material
use_directory_urls: false
nav:
- Welcome: index.md
plugins:
- privacySystem information
- Operating system: macOS Ventura
- Browser: Firefox
Metadata
Metadata
Assignees
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open