Skip to content

Commit

Permalink
Emit a warning if "language = None" setting found (refs: sphinx-doc#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed May 28, 2022
1 parent 63f3d26 commit 3d11413
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sphinx/config.py
Expand Up @@ -167,6 +167,9 @@ def read(cls, confdir: str, overrides: Dict = None, tags: Tags = None) -> "Confi
# Resolve https://github.com/sphinx-doc/sphinx/issues/10474 where conf.py
# explicitly sets language to None, by coercing it to English.
if namespace.get("language", ...) is None:
logging.warning(__("Invalid configuration found: 'language = None'. "
"Now it takes only a string. Please update your configuration. "
"Fallback to 'en' (English)."))
namespace["language"] = "en"

return cls(namespace, overrides or {})
Expand Down

0 comments on commit 3d11413

Please sign in to comment.