From a31c0ddfca721600d630f77a6ef363417f76362c Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 22 Apr 2018 19:25:02 +0900 Subject: [PATCH] Fix #4878: Crashed with extension which returns invalid metadata --- CHANGES | 1 + sphinx/registry.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index ad3fa708e..1f4026ddb 100644 --- a/CHANGES +++ b/CHANGES @@ -32,6 +32,7 @@ Bugs fixed * toctree directive tries to glob for URL having query_string * #4871: html search: Upper characters problem in German * #4717: latex: Compilation for German docs failed with LuaLaTeX and XeLaTeX +* #4878: Crashed with extension which returns invalid metadata Testing -------- diff --git a/sphinx/registry.py b/sphinx/registry.py index cc012b3f7..cdae77224 100644 --- a/sphinx/registry.py +++ b/sphinx/registry.py @@ -340,6 +340,7 @@ class SphinxComponentRegistry(object): logger.warning(__('extension %r returned an unsupported object from ' 'its setup() function; it should return None or a ' 'metadata dictionary'), extname) + metadata = {} app.extensions[extname] = Extension(extname, mod, **metadata) app._setting_up_extension.pop()