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 '__name__' after v3.3.1 #8659

Closed
dbaio opened this issue Jan 6, 2021 · 2 comments
Closed

object has no attribute '__name__' after v3.3.1 #8659

dbaio opened this issue Jan 6, 2021 · 2 comments

Comments

@dbaio
Copy link

dbaio commented Jan 6, 2021

Describe the bug
After updating Sphinx to 3.4.1, getting this error: AttributeError: 'SendRequest' object has no attribute '__name__'.
I'm testing the Sphinx upgrade to 3.4.1 on FreeBSD, and got only this issue when doing an experimental build on all Sphinx consumers with this new version.

To Reproduce
Steps to reproduce the behavior:

$ git clone https://github.com/Pylons/webob.git
$ cd webob/docs
$ make html
running build_sphinx
Running Sphinx v3.4.1
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: all of 0 po files
building [html]: all source files
updating environment: [new config] 24 added, 0 changed, 0 removed
reading sources... [  4%] api/client

Exception occurred:
  File "/usr/local/lib/python3.7/site-packages/sphinx/util/typing.py", line 160, in _restify_py37
    return ':obj:`%s.%s`' % (cls.__module__, cls.__name__)
AttributeError: 'SendRequest' object has no attribute '__name__'
The full traceback has been saved in /tmp/sphinx-err-djqrb8rz.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 1

Expected behavior
On earlier versions, make html works fine.

Your project
https://github.com/Pylons/webob/
https://docs.pylonsproject.org/projects/webob/en/stable/

Environment info

  • OS: FreeBSD
  • Python version: 3.7.9
  • Sphinx version: 3.4.1
  • Sphinx extensions: [sphinx.ext.autodoc, sphinx.ext.intersphinx]
  • Extra tools:

Additional context

$ cat /tmp/sphinx-err-djqrb8rz.log
# Sphinx version: 3.4.1
# Python version: 3.7.9 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.11.2
# Last messages:
#   Running Sphinx v3.4.1
#   making output directory...
#   done
#   loading intersphinx inventory from https://docs.python.org/3/objects.inv...
#   building [mo]: all of 0 po files
#   building [html]: all source files
#   updating environment:
#   [new config]
#   24 added, 0 changed, 0 removed
#   reading sources... [  4%] api/client
# Loaded extensions:
#   sphinx.ext.mathjax (3.4.1) from /usr/local/lib/python3.7/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.2) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.2) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.3) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.4) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.3) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.6) from /usr/local/lib/python3.7/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc.type_comment (3.4.1) from /usr/local/lib/python3.7/site-packages/sphinx/ext/autodoc/type_comment.py
#   sphinx.ext.autodoc (3.4.1) from /usr/local/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.intersphinx (3.4.1) from /usr/local/lib/python3.7/site-packages/sphinx/ext/intersphinx.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sphinx/setup_command.py", line 181, in run
    app.build(force_all=self.all_files)
  File "/usr/local/lib/python3.7/site-packages/sphinx/application.py", line 346, in build
    self.builder.build_all()
  File "/usr/local/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 259, in build_all
    self.build(None, summary=__('all source files'), method='all')
  File "/usr/local/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 310, in build
    updated_docnames = set(self.read())
  File "/usr/local/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 417, in read
    self._read_serial(docnames)
  File "/usr/local/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 438, in _read_serial
    self.read_doc(docname)
  File "/usr/local/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 478, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/usr/local/lib/python3.7/site-packages/sphinx/io.py", line 221, in read_doc
    pub.publish()
  File "/usr/local/lib/python3.7/site-packages/docutils/core.py", line 217, in publish
    self.settings)
  File "/usr/local/lib/python3.7/site-packages/sphinx/io.py", line 126, in read
    self.parse()
  File "/usr/local/lib/python3.7/site-packages/docutils/readers/__init__.py", line 77, in parse
    self.parser.parse(self.input, document)
  File "/usr/local/lib/python3.7/site-packages/sphinx/parsers.py", line 104, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 171, in run
    input_source=document['source'])
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2771, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2771, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2346, in explicit_markup
    self.explicit_list(blank_finish)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2376, in explicit_list
    match_titles=self.state_machine.match_titles)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 319, in nested_list_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2649, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2356, in explicit_construct
    return method(self, expmatch)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2099, in directive
    directive_class, match, type_name, option_presets)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2148, in run_directive
    result = directive_instance.run()
  File "/usr/local/lib/python3.7/site-packages/sphinx/ext/autodoc/directive.py", line 146, in run
    documenter.generate(more_content=self.content)
  File "/usr/local/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1684, in generate
    all_members=all_members)
  File "/usr/local/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 956, in generate
    self.add_content(more_content)
  File "/usr/local/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1665, in add_content
    more_content = StringList([_('alias of %s') % restify(self.object)], source='')
  File "/usr/local/lib/python3.7/site-packages/sphinx/util/typing.py", line 103, in restify
    return _restify_py37(cls)
  File "/usr/local/lib/python3.7/site-packages/sphinx/util/typing.py", line 160, in _restify_py37
    return ':obj:`%s.%s`' % (cls.__module__, cls.__name__)
AttributeError: 'SendRequest' object has no attribute '__name__'
@dbaio dbaio added the type:bug label Jan 6, 2021
@tk0miya
Copy link
Member

tk0miya commented Jan 6, 2021

Sorry for the inconvenience.
I think this is the same as #8616. Could you try the latest release, v3.4.2? I hope it resolves your case.

@dbaio
Copy link
Author

dbaio commented Jan 6, 2021

Sorry for the inconvenience.
I think this is the same as #8616. Could you try the latest release, v3.4.2? I hope it resolves your case.

It worked with v3.4.2.
Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 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