Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#144 AttributeError using :local: with table of content

closed-fixed
nobody
None
5
2010-08-13
2010-08-12
Sebastien Vasey
No

Calling rst2latex on the attached example file produces the following error:

$ rst2latex --traceback test.rst
Traceback (most recent call last):
File "/usr/bin/rst2latex", line 26, in <module>
publish_cmdline(writer_name='latex', description=description)
File "/usr/lib/python2.6/site-packages/docutils/core.py", line 331, in publish_cmdline
config_section=config_section, enable_exit_status=enable_exit_status)
File "/usr/lib/python2.6/site-packages/docutils/core.py", line 205, in publish
output = self.writer.write(self.document, self.destination)
File "/usr/lib/python2.6/site-packages/docutils/writers/__init__.py", line 76, in write
self.translate()
File "/usr/lib/python2.6/site-packages/docutils/writers/latex2e/__init__.py", line 234, in translate
self.document.walkabout(visitor)
File "/usr/lib/python2.6/site-packages/docutils/nodes.py", line 173, in walkabout
if child.walkabout(visitor):
File "/usr/lib/python2.6/site-packages/docutils/nodes.py", line 165, in walkabout
visitor.dispatch_visit(self)
File "/usr/lib/python2.6/site-packages/docutils/nodes.py", line 1601, in dispatch_visit
return method(node)
File "/usr/lib/python2.6/site-packages/docutils/writers/latex2e/__init__.py", line 2751, in visit_topic
self.minitoc(title, node, depth)
File "/usr/lib/python2.6/site-packages/docutils/writers/latex2e/__init__.py", line 2709, in minitoc
base_node=node)
File "/usr/lib/python2.6/site-packages/docutils/utils.py", line 230, in warning
return self.system_message(self.WARNING_LEVEL, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/docutils/utils.py", line 169, in system_message
source, line = get_source_line(kwargs['base_node'])
File "/usr/lib/python2.6/site-packages/docutils/utils.py", line 541, in get_source_line
if node.source or node.line:
AttributeError: 'unicode' object has no attribute 'source'

Removing the `:local:` keyword works around the error.

For information:

$ rst2latex --version
rst2latex (Docutils 0.7 [release], Python 2.6.5, on linux2)

Discussion

  • File producing the error

     
    Attachments
  • Günter Milde
    Günter Milde
    2010-08-13

    • status: open --> closed-fixed