Issue #1509 resolved

TODO extension not compatible with websupport

Dmitry Shachnev
created an issue

Forwarding from This was already reported before as #840, but that bug got no attention and was closed.


by playing with the sphinx's websupport I go to problems with this exception:

pickling environment... done
checking consistency... done
preparing documents... done
Traceback (most recent call last):                                                                                                             
  File "", line 34, in <module>
  File "/usr/lib/python2.7/dist-packages/sphinx/websupport/", line 127, in build
  File "/usr/lib/python2.7/dist-packages/sphinx/", line 212, in build
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/", line 214, in build_update
    'out of date' % len(to_build))
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/", line 276, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/", line 320, in write
    self._write_serial(sorted(docnames), warnings)
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/", line 333, in _write_serial
    self.write_doc(docname, doctree)
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/", line 63, in write_doc
    self.docwriter.write(doctree, destination)
  File "/usr/lib/python2.7/dist-packages/docutils/writers/", line 80, in write
  File "/usr/lib/python2.7/dist-packages/sphinx/writers/", line 51, in translate
  File "/usr/lib/python2.7/dist-packages/docutils/", line 174, in walkabout
    if child.walkabout(visitor):
  File "/usr/lib/python2.7/dist-packages/docutils/", line 174, in walkabout
    if child.walkabout(visitor):
  File "/usr/lib/python2.7/dist-packages/docutils/", line 174, in walkabout
    if child.walkabout(visitor):
  File "/usr/lib/python2.7/dist-packages/docutils/", line 166, in walkabout
  File "/usr/lib/python2.7/dist-packages/sphinx/writers/", line 27, in dispatch_visit
  File "/usr/lib/python2.7/dist-packages/sphinx/writers/", line 34, in handle_visit_commentable
  File "/usr/lib/python2.7/dist-packages/sphinx/writers/", line 43, in add_db_node
    if not storage.has_node(node.uid):
AttributeError: 'paragraph' object has no attribute 'uid'

The websupport is implemented by very basic way:

from sphinx.websupport import WebSupport

support = WebSupport(srcdir="path to source dir",
                     builddir="path to build dir",

After some investigation I find (and confirmed on new empty project), that this is caused by the TODO extension, more precisely by the "todolist" directive, but only if at least one "todo" directive exists. Without any "todo" directive or without "todolist" directive or with the todo_include_todos = False (the default one) all works as expected.

Comments (3)

  1. Takayuki Shimizukawa

    Fix #1509 TODO extension not compatible with websupport

    websupport assigns UID to every node on reading phase and reads it on writing phase. but todolist directive generates new paragraph node on resolving phase. This problem will occur any extensions that generate paragraph nodes on resolving phase.

    This fix changes websupport ignores paragraph node not having UIDs.

    → <<cset bb0211a65072>>

  2. Log in to comment