28 Aug 2012

# Fixing Errors in Epydoc

I ran into this error twice now and wasted an hour both times, so it is time to put this on my universal scratchpad, i.e. this blog.

If you ever get this error when using epydoc:

UNEXPECTED ERROR:
'Text' object has no attribute 'data'


You are probably running a version of Python that is greater than the latest one that is supported by epydoc. This is because epydoc has not been updated since 2008 and Python 2.5.

Luckily, some fine folks on the internet have figured out how to fix these things.

from distutils.sysconfig import get_python_lib
print(get_python_lib())


Go there, navigate to the epydoc\/markup directory and change line 307 of the file restructuredtext.py from

m = self._SUMMARY_RE.match(child.data)


to

try:
m = self._SUMMARY_RE.match(child.data)
except AttributeError:
m = None


This should fix that problem.