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

object has no attribute '__qualname__' after v3.1.0 #7856

Closed
dbaio opened this issue Jun 20, 2020 · 3 comments
Closed

object has no attribute '__qualname__' after v3.1.0 #7856

dbaio opened this issue Jun 20, 2020 · 3 comments

Comments

@dbaio
Copy link

dbaio commented Jun 20, 2020

Describe the bug
After updating Sphinx to 3.1.0 and 3.1.1, getting this error: object has no attribute '__qualname__'

To Reproduce
Steps to reproduce the behavior:

$ git clone https://github.com/weilbith/notmuch-python-bindings.git
$ cd notmuch-python-bindings/docs
$ cd docs
$ make html
[...]
Running Sphinx v3.1.0
making output directory... done
loading intersphinx inventory from https://docs.python.org/objects.inv...
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://docs.python.org/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPSConnectionPool(host='docs.python.org', port=443): Max retries exceeded with url: /objects.inv (Caused by NewConnectionError("<urllib3.connection.VerifiedHTTPSConnection object at 0x80481c450>: Failed to establish a new connection: [Errno 49] Can't assign requested address"))
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 12 source files that are out of date
updating environment: [new config] 12 added, 0 changed, 0 removed
reading sources... [  8%] database
reading sources... [ 16%] filesystem
reading sources... [ 25%] index
reading sources... [ 33%] message
reading sources... [ 41%] messages
reading sources... [ 50%] notes
reading sources... [ 58%] query
reading sources... [ 66%] quickstart
reading sources... [ 75%] status_and_errors

Exception occurred:
  File "/usr/local/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1404, in format_signature
    qualname = '.'.join([self._signature_class.__qualname__,
AttributeError: 'Status' object has no attribute '__qualname__'
The full traceback has been saved in /tmp/sphinx-err-vxd7puu8.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!
*** Error code 2

Expected behavior
On earlier versions, make html works fine.

Your project
https://github.com/weilbith/notmuch-python-bindings/tree/master/docs

Environment info

  • OS: Mac/FreeBSD
  • Python version: 3.7
  • Sphinx version: 3.1.0 / 3.1.1
  • Sphinx extensions: ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo']
  • Extra tools:

Additional context
weilbith/notmuch-python-bindings#2

@dbaio dbaio added the type:bug label Jun 20, 2020
@tk0miya
Copy link
Member

tk0miya commented Jun 21, 2020

It seems notmuch.STATUS is an enum object, not a class. So I don't think this is not a bug of autodoc.
https://github.com/weilbith/notmuch-python-bindings/blob/0867e4166002e3584c442a0646b0d67fe9dd6e04/notmuch/errors.py#L48-L62

Note: You can deceive autodoc via adding __qualname__ to STATUS object same as what you do to __name__.

@tk0miya
Copy link
Member

tk0miya commented Jun 21, 2020

I posted a PR #7858 to prevent a crash even if an invalid object is passed.

@dbaio
Copy link
Author

dbaio commented Jun 21, 2020

I posted a PR #7858 to prevent a crash even if an invalid object is passed.

Thank you for taking a look.
It will help and I reported this issue to the project as well.

tk0miya added a commit that referenced this issue Jun 26, 2020
…classobj

Fix #7856: autodoc: AttributeError is raised for non-class object
@tk0miya tk0miya closed this as completed in 0be0801 Jul 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 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

2 participants