You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: expected str, bytes or os.PathLike object, not NoneType
None is a valid value since MkDocs 1.6, as described here:
Since MkDocs 1.6 a file may alternatively be stored in memory - content_string/content_bytes.
Then src_dir and abs_src_path will remain None. content_bytes/content_string need to be written to, or populated through the content argument in the constructor.
The (valid) code in my plugin which causes privacy plugin to crash is this:
Thanks for reporting. Fixed in 968fbe1. To be honest, a fundamental change like this to MkDocs' plugin API would actually mandate a major release, IMHO. We're probably not the only plugin that is impacted by this breaking change.
Context
The bug was encountered by a user of mkdocs-d2-plugin. Relevant issue: landmaj/mkdocs-d2-plugin#21
Bug description
The privacy plugin passes
abs_src_path
toopen()
without checking forNone
, which results in an error:None
is a valid value since MkDocs 1.6, as described here:The (valid) code in my plugin which causes privacy plugin to crash is this:
Related links
Reproduction
9.5.48-privacy-plugin-crash.zip
Steps to reproduce
mkdocs build
withprivacy
andd2
plugins enabled.Browser
No response
Before submitting
The text was updated successfully, but these errors were encountered: