Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx.ext.autodoc.typehints throws ValueError on pyqtSignal/Signal (PyQt5/PySide2) #7138

Closed
samh opened this issue Feb 11, 2020 · 2 comments

Comments

@samh
Copy link

samh commented Feb 11, 2020

Describe the bug
Code using pyqtSignal from PyQt5 causes Sphinx to throw ValueError: no signature found for builtin <unbound signal activated>. For PySide2 (Signal), it throws ValueError: callable <PySide2.QtCore.Signal object at 0x7fa76b0c4270> is not supported by signature.

To Reproduce
Steps to reproduce the behavior:

$ git clone https://github.com/samh/sphinx-typehints-bug
$ cd sphinx-typehints-bug
$ pip install -r requirements.txt
$ make html

Expected behavior
Expected no error.

Your project
Sample project: https://github.com/samh/sphinx-typehints-bug

In my real project I am using PyQt5, but a similar error appears to happen with PySide2, and that was easier to set up for a sample.

Screenshots
If applicable, add screenshots to help explain your problem.

Output using PySide2 5.14.1:

(.venv) [samh@devdmsa sphinx-pyqt5-bug]$ make html
Running Sphinx v2.4.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: [extensions changed ('sphinx.ext.autodoc.typehints')] 1 added, 0 changed, 0 removed
reading sources... [100%] index                                                                                                                       
Exception occurred:
  File "/opt/python36/lib/python3.6/inspect.py", line 2381, in _signature_from_callable
    raise ValueError('callable {!r} is not supported by signature'.format(obj))
ValueError: callable <PySide2.QtCore.Signal object at 0x7fa76b0c4270> is not supported by signature
The full traceback has been saved in /tmp/sphinx-err-q6sdtg7i.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 2

Output using PyQt 5.4.2:

cd docs && make html
<removed>
make[1]: Entering directory `<removed>'
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v2.4.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] python/qt                                                                                                                                                                                                                                                                                     
Exception occurred:
  File "/opt/python36/lib/python3.6/inspect.py", line 2097, in _signature_from_builtin
    raise ValueError("no signature found for builtin {!r}".format(func))
ValueError: no signature found for builtin <unbound signal >
The full traceback has been saved in /tmp/sphinx-err-k_o1ibbv.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[1]: *** [html] Error 2
make[1]: Leaving directory `<removed>'
make: *** [doc-html] Error 2

Environment info

  • OS: Linux, tested on RHEL 6 and 7
  • Python version: 3.6.10
  • Sphinx version: 2.4.1
  • Sphinx extensions: sphinx.ext.autodoc.typehints
  • Extra tools: None

Additional context
Add any other context about the problem here.

@gpotter2
Copy link
Contributor

Also reproducible with any other ctypes structure.

Exception occurred:
  File "/usr/lib/python3.6/inspect.py", line 2349, in _signature_from_callable
    'no signature found for builtin type {!r}'.format(obj))
ValueError: no signature found for builtin type <class 'scapy.supersocket.tpacket_auxdata'>

tk0miya added a commit that referenced this issue Feb 13, 2020
…ndobj

Fix #7138: autodoc: crashed when variable has unbound object
@tk0miya
Copy link
Member

tk0miya commented Feb 13, 2020

Fixed. It will be released after fixing other reported bug.
Thank you for reporting!

@tk0miya tk0miya closed this as completed Feb 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants