Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Sphinx autodoc will not properly handle non-Python functions #20

Open
herczy opened this issue Nov 24, 2015 · 0 comments
Open

Sphinx autodoc will not properly handle non-Python functions #20

herczy opened this issue Nov 24, 2015 · 0 comments
Labels

Comments

@herczy
Copy link
Collaborator

herczy commented Nov 24, 2015

I noticed that if a function is imported from a C library we get an error with the sphinx autodoc. I.e. the autodoc will produce an error for the following module:

from hashlib import md5

The exception was:

  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 1303, in run
    documenter.generate(more_content=self.content)
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 734, in generate
    self.document_members(all_members)
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 659, in document_members
    check_module=members_check_module and not isattr)
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 721, in generate
    sig = self.format_signature()
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 901, in format_signature
    return Documenter.format_signature(self)
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 399, in format_signature
    self.object, self.options, args, retann)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 318, in emit_firstresult
    for result in self.emit(event, *args):
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 314, in emit
    results.append(callback(self, *args))
  File "/usr/lib/python3.2/site-packages/typesafety/sphinxautodoc.py", line 44, in add_annotations_to_signature
    arg_spec = inspect.getfullargspec(func)
  File "/usr/lib/python3.2/inspect.py", line 834, in getfullargspec
    raise TypeError('{!r} is not a Python function'.format(func))
TypeError: <built-in function openssl_md5> is not a Python function
@herczy herczy added the bug label Nov 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant