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

3.4.0 inspect.getslots fail with TypeError #8568

Closed
ravwojdyla opened this issue Dec 21, 2020 · 0 comments
Closed

3.4.0 inspect.getslots fail with TypeError #8568

ravwojdyla opened this issue Dec 21, 2020 · 0 comments

Comments

@ravwojdyla
Copy link
Contributor

ravwojdyla commented Dec 21, 2020

After upgrade from 3.3.1 to 3.4.0 Dask's doc CI is failing with:

Exception occurred:
  File "/usr/local/lib/python3.8/site-packages/sphinx/util/inspect.py", line 193, in getslots
    raise TypeError
TypeError
Full stacktrace
  File "/usr/local/bin/sphinx-build", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 294, in main
    return build_main(argv)
  File "/usr/local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/usr/local/lib/python3.8/site-packages/sphinx/application.py", line 352, in build                                                                                                                                                                                                                                                                                                                                                                                                        self.builder.build_update()
  File "/usr/local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 296, in build_update                                                                                                                                                                                                                                                                                                                                                                                           self.build(to_build,
  File "/usr/local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 310, in build                                                                                                                                                                                                                                                                                                                                                                                                  updated_docnames = set(self.read())
  File "/usr/local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 417, in read
    self._read_serial(docnames)                                                                                                                                                                                                                                                                                                                                                                                                                                                                File "/usr/local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 438, in _read_serial
    self.read_doc(docname)
  File "/usr/local/lib/python3.8/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.8/site-packages/sphinx/io.py", line 221, in read_doc
    pub.publish()                                                                                                                                                                                                                                                                                                                                                                                                                                                                              File "/usr/local/lib/python3.8/site-packages/docutils/core.py", line 217, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/usr/local/lib/python3.8/site-packages/sphinx/io.py", line 126, in read                                                                                                                                                                                                                                                                                                                                                                                                                  self.parse()
  File "/usr/local/lib/python3.8/site-packages/docutils/readers/__init__.py", line 77, in parse
    self.parser.parse(self.input, document)                                                                                                                                                                                                                                                                                                                                                                                                                                                    File "/usr/local/lib/python3.8/site-packages/sphinx/parsers.py", line 104, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 170, in run                                                                                                                                                                                                                                                                                                                                                                                                 results = StateMachineWS.run(self, input_lines, input_offset,                                                                                                                                                                                                                                                                                                                                                                                                                              File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line                                                                                                                                                                                                                                                                                                                                                                                                return method(match, context, next_state)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline                                                                                                                                                                                                                                                                                                                                                                                          self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section                                                                                                                                                                                                                                                                                                                                                                                             self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection                                                                                                                                                                                                                                                                                                                                                                                      newabsoffset = self.nested_parse(
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2344, in explicit_markup
    self.explicit_list(blank_finish)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2369, in explicit_list
    newline_offset, blank_finish = self.nested_list_parse(
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 318, in nested_list_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/local/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2647, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2096, in directive
    return self.run_directive(
  File "/usr/local/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "/usr/local/lib/python3.8/site-packages/sphinx/ext/autosummary/__init__.py", line 247, in run
    items = self.get_items(names)
  File "/usr/local/lib/python3.8/site-packages/sphinx/ext/autosummary/__init__.py", line 349, in get_items
    if not documenter.import_object():
  File "/usr/local/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 2314, in import_object
    ret = super().import_object(raiseerror=True)
  File "/usr/local/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 2122, in import_object
    if self.isslotsattribute():
  File "/usr/local/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 2112, in isslotsattribute
    __slots__ = inspect.getslots(self.parent)
  File "/usr/local/lib/python3.8/site-packages/sphinx/util/inspect.py", line 194, in getslots
    traceback.print_stack()

The error seem to be that

__slots__ = inspect.getslots(self.parent)
gets module as an argument which raises TypeError, which is not captured and raises up. Would it be enough to just add TypeError to except, or is there a better way to handle this. In the meantime created a PR with the TypeError ignore.

See issue: dask/dask#7001, example of failure: doc CI.

To Reproduce

  1. clone dask master
  2. follow instructions from https://github.com/dask/dask/blob/master/docs/README.rst

Environment info

  • OS: [e.g. Unix/Linux/Mac]
  • Python version: 3.8
  • Sphinx version: 3.4.0

Additional context
dask/dask#7001

ravwojdyla added a commit to ravwojdyla/sphinx that referenced this issue Dec 21, 2020
@tk0miya tk0miya added this to the 3.4.1 milestone Dec 21, 2020
tk0miya pushed a commit to tk0miya/sphinx that referenced this issue Dec 21, 2020
tk0miya added a commit that referenced this issue Dec 21, 2020
Fixes #8568. Ignore TypeError from getslots in isslotsattribute
@tk0miya tk0miya closed this as completed Dec 21, 2020
eivindjahren added a commit to equinor/resdata that referenced this issue Dec 22, 2020
ecl does not currently work with sphinx version 3.4.0,
because of sphinx-doc/sphinx#8568
eivindjahren added a commit to equinor/resdata that referenced this issue Dec 22, 2020
Build ecl docs does not currently work with sphinx version 3.4.0,
because of sphinx-doc/sphinx#8568
markusdregi pushed a commit to equinor/resdata that referenced this issue Dec 22, 2020
Build ecl docs does not currently work with sphinx version 3.4.0,
because of sphinx-doc/sphinx#8568
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 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