From 8e353e3103b5bbeacfe447304f3b4dabfaaf5da2 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 29 May 2022 02:53:23 +0900 Subject: [PATCH] Emit a warning if "language = None" setting found (refs: #10474) --- sphinx/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sphinx/config.py b/sphinx/config.py index 27653f307a4..9b32d7f95e7 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -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 "