Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

epydoc AttributeError: 'Text' object has no attribute 'data'

Tags:

python

epydoc

I've not used epydoc in the last 2 years but I found it very handy to take track of my classes and methods with a very little effort.

Today I installed latest version 3.0.1 but I get this error and searching around seems no solutions are provided.

Traceback (most recent call last):-] Parsing docstrings: pyramid.reques... 
  File "/home/neurino/apps/env/bin/epydoc", line 13, in <module>
    cli()
  File "/home/neurino/apps/env/lib/python2.7/site-packages/epydoc/cli.py", line 965, in cli
    main(options, names)
  File "/home/neurino/apps/env/lib/python2.7/site-packages/epydoc/cli.py", line 757, in main
    exclude_parse=exclude_parse)
  File "/home/neurino/apps/env/lib/python2.7/site-packages/epydoc/docbuilder.py", line 275, in build_doc_index
    parse_docstring(val_doc, docindex, suppress_warnings)
  File "/home/neurino/apps/env/lib/python2.7/site-packages/epydoc/docstringparser.py", line 265, in parse_docstring
    api_doc.summary, api_doc.other_docs = api_doc.descr.summary()
  File "/home/neurino/apps/env/lib/python2.7/site-packages/epydoc/markup/restructuredtext.py", line 179, in summary
    try: self._document.walk(visitor)
  File "/home/neurino/apps/env/lib/python2.7/site-packages/docutils/nodes.py", line 137, in walk
    if child.walk(visitor):
  File "/home/neurino/apps/env/lib/python2.7/site-packages/docutils/nodes.py", line 129, in walk
    visitor.dispatch_visit(self)
  File "/home/neurino/apps/env/lib/python2.7/site-packages/docutils/nodes.py", line 1604, in dispatch_visit
    return method(node)
  File "/home/neurino/apps/env/lib/python2.7/site-packages/epydoc/markup/restructuredtext.py", line 307, in visit_paragraph
    m = self._SUMMARY_RE.match(child.data)
AttributeError: 'Text' object has no attribute 'data'

Is epydoc project dead?

like image 813
neurino Avatar asked Jul 15 '11 09:07

neurino


2 Answers

I found a patch on epydoc tracker, it was outdated anyway this part solves the problem:

markup/restructuredtext.py
307c307,310
<                 m = self._SUMMARY_RE.match(child.data)
---
>                 try:
>                     m = self._SUMMARY_RE.match(child.data)
>                 except AttributeError:
>                     m = None
like image 141
neurino Avatar answered Nov 05 '22 12:11

neurino


Epydoc has not been maintained for long time and the last release is not quite compatible with current Pyton and docutils. It is still a useful tool, though, but needs some patching.

Here are some patches I used with Epydoc to build documentation for my Python 2.7 code: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/epydoc/ (they are part of the PLD-Linux Epydoc package).

I wish someone takes over the code and continue the development…

like image 36
Jacek Konieczny Avatar answered Nov 05 '22 12:11

Jacek Konieczny