Commits

Takayuki Shimizukawa committed 91c12af

remove unusable 'SEVERE: Duplicate ID' message for footnote that the translation node has been recognized as a duplicate.

  • Participants
  • Parent commits 6fc25e0

Comments (0)

Files changed (2)

File sphinx/environment.py

                               'translated message', node)
             for old, new in zip(old_foot_refs, new_foot_refs):
                 new['ids'] = old['ids']
+                for id in new['ids']:
+                    self.document.ids[id] = new
                 self.document.autofootnote_refs.remove(old)
                 self.document.note_autofootnote_ref(new)
 

File tests/test_intl.py

     # expect no error by build
 
 
-@with_intl_app(buildername='text', cleanenv=True)
+@with_intl_app(buildername='text', warning=warnfile)
 def test_i18n_footnote_regression(app):
     """regression test for fix #955"""
+    app.builddir.rmtree(True)
     app.builder.build(['footnote'])
     result = (app.outdir / 'footnote.txt').text(encoding='utf-8')
     expect = (u"\nI18N WITH FOOTNOTE"
               u"\n[100] THIS IS A NUMBERED FOOTNOTE.\n")
     assert result == expect
 
+    warnings = warnfile.getvalue().replace(os.sep, '/')
+    warning_expr = u'.*/footnote.txt:\\d*: SEVERE: Duplicate ID: ".*".\n'
+    assert not re.search(warning_expr, warnings)
+
 
 @with_intl_app(buildername='html', cleanenv=True)
 def test_i18n_footnote_backlink(app):