Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty mkdocs_theme.yml file in custom theme leads to exception on mkdocs serve #1602

chrissimpkins opened this issue Aug 22, 2018 · 2 comments


Copy link

Reported by @Martian101 on the Cinder theme repository here chrissimpkins/cinder#46.

Our custom theme was released with an empty mkdocs_theme.yml file in the root of the theme directory. The user experienced the following AttributeError when the mkdocs serve command was executed:

Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 11, in <module>
  File "/usr/local/lib/python3.5/dist-packages/click/", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/click/", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.5/dist-packages/click/", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.5/dist-packages/click/", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.5/dist-packages/click/", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/", line 134, in serve_command
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/commands/", line 119, in serve
    config = builder()
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/commands/", line 107, in builder
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/config/", line 197, in load_config
    errors, warnings = cfg.validate()
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/config/", line 115, in validate
    post_failed, post_warnings = self._post_validate()
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/config/", line 95, in _post_validate
    config_option.post_validation(self, key_name=key)
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/config/", line 432, in post_validation
    config[key_name] = theme.Theme(**theme_config)
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/", line 47, in __init__
  File "/usr/local/lib/python3.5/dist-packages/mkdocs/", line 96, in _load_theme_config
    parent_theme = theme_config.pop('extends', None)
AttributeError: 'NoneType' object has no attribute 'pop'

According to your documentation, an empty settings file appears to be acceptable and supported ( so I am reporting as a possible bug or need for documentation update here.

Copy link

waylan commented Aug 22, 2018

Fixed in #1603

@waylan waylan closed this as completed Aug 22, 2018
Copy link


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants