diff --git a/CHANGES b/CHANGES index ee550517a..3fce72ab7 100644 --- a/CHANGES +++ b/CHANGES @@ -109,6 +109,8 @@ Bugs fixed * #1316: Remove hard-coded ``font-face`` resources from epub theme. +* #1329: Fix traceback with empty translation msgstr in .po files. + Documentation ------------- diff --git a/sphinx/transforms.py b/sphinx/transforms.py index 338d47392..14e2c97fd 100644 --- a/sphinx/transforms.py +++ b/sphinx/transforms.py @@ -196,7 +196,10 @@ class Locale(Transform): patch = new_document(source, settings) CustomLocaleReporter(node.source, node.line).set_reporter(patch) parser.parse(msgstr, patch) - patch = patch[0] + try: + patch = patch[0] + except IndexError: # empty node + pass # XXX doctest and other block markup if not isinstance(patch, nodes.paragraph): continue # skip for now @@ -299,7 +302,10 @@ class Locale(Transform): patch = new_document(source, settings) CustomLocaleReporter(node.source, node.line).set_reporter(patch) parser.parse(msgstr, patch) - patch = patch[0] + try: + patch = patch[0] + except IndexError: # empty node + pass # XXX doctest and other block markup if not isinstance(patch, nodes.paragraph): continue # skip for now