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

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

@herczy

Description

@herczy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions