Fix #6718: i18n: KeyError is raised if section title and table title are same

This commit is contained in:
Takeshi KOMIYA
2019-10-13 01:36:05 +09:00
parent f59ebed3bd
commit a790ca580b
2 changed files with 2 additions and 1 deletions

View File

@@ -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)

View File

@@ -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())