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 crashed when enabling sphinxcontrib-trimblank #7195

Closed
tk0miya opened this issue Feb 22, 2020 · 0 comments
Closed

Sphinx crashed when enabling sphinxcontrib-trimblank #7195

tk0miya opened this issue Feb 22, 2020 · 0 comments

Comments

@tk0miya
Copy link
Member

tk0miya commented Feb 22, 2020

Describe the bug
Sphinx crashed when enabling sphinxcontrib-trimblank

To Reproduce

Traceback (most recent call last):
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app.build(args.force_all, filenames)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/application.py", line 349, in build
    self.builder.build_update()
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 299, in build_update
    len(to_build))
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 361, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 535, in write
    self._write_serial(sorted(docnames))
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 542, in _write_serial
    doctree = self.env.get_and_resolve_doctree(docname, self)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 537, in get_and_resolve_doctree
    self.apply_post_transforms(doctree, docname)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 588, in apply_post_transforms
    self.events.emit('doctree-resolved', doctree, docname)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/events.py", line 99, in emit
    results.append(callback(self.app, *args))
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/ext/todo.py", line 158, in __init__
    self.process(doctree, docname)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/ext/todo.py", line 178, in process
    self.env.resolve_references(new_todo, todo['docname'], self.builder)  # type: ignore  # NOQA
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 571, in resolve_references
    self.apply_post_transforms(doctree, fromdocname)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 588, in apply_post_transforms
    self.events.emit('doctree-resolved', doctree, docname)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinx/events.py", line 99, in emit
    results.append(callback(self.app, *args))
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/sphinxcontrib/trimblank.py", line 122, in trimblank
    doctree.walk(visitor)
  File "/home/gohki/.venv/sphinx/lib/python3.7/site-packages/docutils/nodes.py", line 129, in walk
    visitor.document.reporter.debug(
AttributeError: 'todo_node' object has no attribute 'reporter'

Expected behavior
Build successfully.

Your project
https://github.com/sphinxjp/sphinx-users.jp

Screenshots
N/A

Environment info

  • OS: Mac
  • Python version: 3.8.1
  • Sphinx version: 2.4.2
  • Sphinx extensions: sphinxcontrib.trimblank
  • Extra tools: Nothing

reported by @usaturn (thanks!)

@tk0miya tk0miya added this to the 2.4.3 milestone Feb 22, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Feb 22, 2020
tk0miya added a commit that referenced this issue Feb 22, 2020
…olved

Fix #7195: todo: emit doctree-resolved event with non-document node incorrectly
@tk0miya tk0miya closed this as completed Feb 22, 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

1 participant