epydoc AttributeError: 'Text' object has no attribute 'data'
Asked Answered
P

3

7

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?

Pogge answered 15/7, 2011 at 9:1 Comment(3)
(When you can,) you should post this as an answer and accept it -- for future generations!Rowan
I know but it won't let me add an answer until a certain amount of hours and often I forget about it so, for future generations, I'm leaving something this way... :) I hope to remember next days to add answer a real answer.Pogge
I was wrong... I can answer but not accept, thanks for the tipPogge
B
6

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…

Bessette answered 15/7, 2011 at 11:7 Comment(0)
P
8

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
Pogge answered 15/7, 2011 at 10:14 Comment(1)
Yes, these changes fix it. I had to make the changes manually though.Bharal
B
6

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…

Bessette answered 15/7, 2011 at 11:7 Comment(0)
K
0

Objects can be tested against null (i.e. None) so that the exception could not be occurred.

if object is None:
Kiger answered 2/1, 2016 at 20:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.