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 authored and AA-Turner committed May 28, 2022
1 parent a3d0983 commit 8e353e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sphinx/config.py
Expand Up @@ -168,6 +168,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"
warnings.warn("'None' is not a valid value for 'language', coercing to 'en'. "
"Update 'conf.py' to a valid language code to silence this "
Expand Down

0 comments on commit 8e353e3

Please sign in to comment.