I'm not very familiar with mkdocs or mkdocs plugin internals however.
Traceback (most recent call last):
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/mkdocs/__main__.py", line 192, in <module>
cli()
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/mkdocs/__main__.py", line 152, in build_command
build.build(config.load_config(**kwargs), dirty=not clean)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/mkdocs/commands/build.py", line 271, in build
_populate_page(file.page, config, files, dirty)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/mkdocs/commands/build.py", line 168, in _populate_page
'page_markdown', page.markdown, page=page, config=config, files=files
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/mkdocs/plugins.py", line 94, in run_event
result = method(item, **kwargs)
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/mkdocs_table_reader_plugin/plugin.py", line 127, in on_page_markdown
with cd(mkdocs_dir):
File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/site-packages/mkdocs_table_reader_plugin/plugin.py", line 50, in __enter__
os.chdir(self.newPath)
FileNotFoundError: [Errno 2] No such file or directory: ''
When calling mkdocs with a
mkdocs.yml
in the working dir, the plugin will try to effectively callwith cd('')
, throwing the attached stack trace.Mkdocs, version is 1.1.2, and was called with:
Calling mkdocs build with
--config-file mkdocs.yml
, this line returnsmkdocs_dir = ""
, which will fail below atwith cd(""):
https://github.com/timvink/mkdocs-table-reader-plugin/blob/master/mkdocs_table_reader_plugin/plugin.py#L99
Local resolution for me was:
I'm not very familiar with mkdocs or mkdocs plugin internals however.