* Nikolaus Rath <nikol...@rath.org>, 2011-06-15, 12:57:
======================================================================
FAIL: test_autodoc.test_generate
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/usr/lib/pymodules/python2.6/nose/case.py", line 187, in runTest
   self.test(*self.arg)
 File "/home/nikratio/tmp/sphinx/tests/test_autodoc.py", line 486, in
test_generate
   assert_processes([('function', 'time.asctime')], 'function', 'asctime')
 File "/home/nikratio/tmp/sphinx/tests/test_autodoc.py", line 351, in
assert_processes
   assert_works(objtype, name, **kw)
 File "/home/nikratio/tmp/sphinx/tests/test_autodoc.py", line 345, in
assert_works
   assert len(_warnings) == 0, _warnings
AssertionError: ["error while formatting arguments for time.asctime:
<method-wrapper '__init__' of builtin_function_or_method object at
0x7f1f5b049a28> is not a Python function"]

----------------------------------------------------------------------


I stared at this for quite a while, but I don't understand what's going on.

This hunk looks fishy:

| @@ -847,8 +893,8 @@
|      def format_args(self):
|          if inspect.isbuiltin(self.object) or \
|                 inspect.ismethoddescriptor(self.object):
| -            # can never get arguments of a C function or method
| -            return None
| +            # cannot introspect arguments of a C function or method
| +            pass
|          try:
|              argspec = inspect.getargspec(self.object)
|          except TypeError:

If it is intentional that format_args raises an exception on builtins etc., then the whole if statement could be removed. If this is not the case, the change is incorrect.

I think we have to wait for upstream to fix this bug, or just accept upstream's default. Would the later be possible?

I'd rather reluctant to enable it by default.

Note that this patch really only becomes effective if Sphinx did not find any other way to retrieve a signature,

This is not my understanding. AFAICS it always tries to extract signature form docstrings and only falls back to introspection, not the other way round.

--
Jakub Wilk



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to