question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MyST crashes without error message (breathe extension)

See original GitHub issue

Describe the bug

MyST crashes without error message if “directive_class” is not a class.

To Reproduce

Cannot reproduce, because the error message does not mention the problematic file and the document is confidential.

Expected behavior

MyST should catch the issue that something passed to run_directive is not a known directive class.

Environment

  • OS: Ubuntu 18.04
  • Sphinx version: 3.5.1
  • Python version: 3.6.9 (CPython)
  • Docutils version: 0.16 release
  • Jinja2 version: 2.11.3

Additional context

full trace log:

#   
# Loaded extensions:
#   sphinx.ext.mathjax (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.2) from /home/username/.local/lib/python3.6/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.2) from /home/username/.local/lib/python3.6/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.3) from /home/username/.local/lib/python3.6/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.4) from /home/username/.local/lib/python3.6/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.3) from /home/username/.local/lib/python3.6/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /home/username/.local/lib/python3.6/site-packages/alabaster/__init__.py
#   breathe (4.27.0) from /home/username/.local/lib/python3.6/site-packages/breathe/__init__.py
#   sphinx.ext.autodoc.type_comment (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/autodoc/type_comment.py
#   sphinx.ext.autodoc (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.doctest (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/doctest.py
#   sphinx.ext.todo (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/todo.py
#   sphinx.ext.ifconfig (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/ifconfig.py
#   sphinx.ext.viewcode (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/viewcode.py
#   sphinx.ext.extlinks (3.5.1) from /home/username/.local/lib/python3.6/site-packages/sphinx/ext/extlinks.py
#   sphinx_markdown_tables (<module 'sphinx_markdown_tables.__version__' from '/usr/local/lib/python3.6/dist-packages/sphinx_markdown_tables/__version__.py'>) from /usr/local/lib/python3.6/dist-packages/sphinx_markdown_tables/__init__.py
#   sphinxcontrib.confluencebuilder (1.4.0) from /home/username/.local/lib/python3.6/site-packages/sphinxcontrib/confluencebuilder/__init__.py
#   sphinxcontrib.plantuml (unknown version) from /usr/local/lib/python3.6/dist-packages/sphinxcontrib/plantuml.py
#   myst_parser (0.13.5) from /home/username/.local/lib/python3.6/site-packages/myst_parser/__init__.py
#   sphinx_git (unknown version) from /usr/local/lib/python3.6/dist-packages/sphinx_git/__init__.py
#   sphinx_rtd_theme (unknown version) from /usr/local/lib/python3.6/dist-packages/sphinx_rtd_theme/__init__.py
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/application.py", line 352, in build
    self.builder.build_update()
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 298, in build_update
    len(to_build))
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 310, in build
    updated_docnames = set(self.read())
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 417, in read
    self._read_serial(docnames)
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 438, in _read_serial
    self.read_doc(docname)
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 478, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/io.py", line 221, in read_doc
    pub.publish()
  File "/home/username/.local/lib/python3.6/site-packages/docutils/core.py", line 218, in publish
    self.settings)
  File "/home/username/.local/lib/python3.6/site-packages/sphinx/io.py", line 126, in read
    self.parse()
  File "/home/username/.local/lib/python3.6/site-packages/docutils/readers/__init__.py", line 77, in parse
    self.parser.parse(self.input, document)
  File "/home/username/.local/lib/python3.6/site-packages/myst_parser/sphinx_parser.py", line 195, in parse
    parser.renderer.render(tokens, parser.options, env)
  File "/home/username/.local/lib/python3.6/site-packages/myst_parser/docutils_renderer.py", line 174, in render
    self.rules[f"render_{nest_token.type}"](nest_token)
  File "/home/username/.local/lib/python3.6/site-packages/myst_parser/docutils_renderer.py", line 449, in render_fence
    return self.render_directive(token)
  File "/home/username/.local/lib/python3.6/site-packages/myst_parser/docutils_renderer.py", line 939, in render_directive
    nodes_list = self.run_directive(name, arguments, content, position)
  File "/home/username/.local/lib/python3.6/site-packages/myst_parser/docutils_renderer.py", line 970, in run_directive
    if issubclass(directive_class, Include):
TypeError: issubclass() arg 1 must be a class

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chrisjsewellcommented, Mar 2, 2021

At a guess this something to do with the way breathe handles directive registration: https://github.com/michaeljones/breathe/blob/4ce8c7a0d79f79f0ae3e7c7fbaa9c4fbb5c84888/breathe/directives.py#L564-L573

1reaction
arweduscommented, Mar 2, 2021

I’ll set up a mini sphinx+breathe+MyST example later, I guess that’s what happens here. See also my related issue. I put a try… execpt around the line 970 locally, and since then I’ve been seing the doxygenstruct related error messages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems with ue4-myst "fatal error"
Every time I try to interact with the book to go to D'ni, the game crashes with the same, nebulous, "ue4-myst fatal error"...
Read more >
How to stop Myst crashing? :: Myst: Masterpiece Edition ...
The game keeps breaking and I keep having to open Task Manager to close it. Problems include the game crashing when I click...
Read more >
SecuROM
Game Series Released 25 to Life January 17, 2006 7.62 High Calibre Brigade E5 August 24, 2007 A Vampyre Story December 2, 2008
Read more >
Crash Bandicoot Co-Creator Andy Gavin: Extended Interview
Ars Technica is proud to present our extended interview with Crash Bandicoot co-creator Andy Gavin. Andy goes into deep, engaging detail in ...
Read more >
Sphinx Documentation
Execute make without an argument to see which targets are available. ... extensions for automatic code documentation, like Breathe30.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found