From a790ca580b1c0724fa073de9496b0360d7c934aa Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 13 Oct 2019 01:36:05 +0900 Subject: [PATCH] Fix #6718: i18n: KeyError is raised if section title and table title are same --- CHANGES | 1 + sphinx/transforms/i18n.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index cad76cd50..26ea1afb6 100644 --- a/CHANGES +++ b/CHANGES @@ -31,6 +31,7 @@ Bugs fixed * #6704: linkcheck: Be defensive and handle newly defined HTTP error code * #6655: image URLs containing ``data:`` causes gettext builder crashed * #6584: i18n: Error when compiling message catalogs on Hindi +* #6718: i18n: KeyError is raised if section title and table title are same * #6708: mathbase: Some deprecated functions have removed * #6709: autodoc: mock object does not work as a class decorator * #6712: Allow not to install sphinx.testing as runtime (mainly for ALT Linux) diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index d970670a1..8435d4b7a 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -134,7 +134,7 @@ class Locale(SphinxTransform): processed = False # skip flag # update title(section) target name-id mapping - if isinstance(node, nodes.title): + if isinstance(node, nodes.title) and isinstance(node.parent, nodes.section): section_node = node.parent new_name = nodes.fully_normalize_name(patch.astext()) old_name = nodes.fully_normalize_name(node.astext())