clone 527496 -1
severity -1 minor
reassign -1 python-sphinx 0.6.2-1
retitle -1 python-sphinx: better error message needed when using autoclass with
a non-class
tags 527496 + patch
thanks
* Daniel Schepler <dschep...@gmail.com>, 2009-05-07, 13:54:
...
mkdir docs/_static # Sphinx needs it
PYTHONPATH=. sphinx-build -N -q -E -b html docs/
debian/python-webob/usr/share/doc/python-webob/docs/
Exception occurred:
File "/usr/lib/pymodules/python2.5/sphinx/ext/autodoc.py", line 844, in
import_object
self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
AttributeError: 'datetime.timedelta' object has no attribute '__name__'
The full traceback has been saved in /tmp/sphinx-err-gkORHk.log, if you want to
report the issue to the author.
Please also report this if it was a user error, so that a better error message
can be provided next time.
Send reports to sphinx-...@googlegroups.com. Thanks!
make: *** [build-docs] Error 1
Thanks for your report.
The attached patch fixes the problem.
However, python-sphinx should in such a situation (i.e. somebody uses
autoclass directive on something that is not a class) give a more
helpful error message.
--
Jakub Wilk
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@
Uploaders: Christoph Haas <h...@debian.org>, Piotr OĹźarowski <pi...@debian.org>
Build-Depends: debhelper (>= 5)
Build-Depends-Indep: python (>= 2.3.3), python-all-dev, python-support (>= 0.6.4),
- python-setuptools (>= 0.6b3-1~), python-sphinx
+ python-setuptools (>= 0.6b3-1~), python-sphinx (>= 0.6)
Standards-Version: 3.8.0
XS-Python-Version: all
Homepage: http://pythonpaste.org/webob/
diff --git a/docs/modules/webob.txt b/docs/modules/webob.txt
--- a/docs/modules/webob.txt
+++ b/docs/modules/webob.txt
@@ -44,16 +44,13 @@
.. autofunction:: webob.html_escape
-.. comment:
- not sure what to do with these constants; not autoclass
-
-.. autoclass:: webob.day
-.. autoclass:: webob.week
-.. autoclass:: webob.hour
-.. autoclass:: webob.minute
-.. autoclass:: webob.second
-.. autoclass:: webob.month
-.. autoclass:: webob.year
+.. autodata:: webob.day
+.. autodata:: webob.week
+.. autodata:: webob.hour
+.. autodata:: webob.minute
+.. autodata:: webob.second
+.. autodata:: webob.month
+.. autodata:: webob.year
.. autoclass:: webob.AppIterRange