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

Vague error when there is an empty @ClassFolder #225

Closed
willem-pennings opened this issue Nov 30, 2023 · 1 comment
Closed

Vague error when there is an empty @ClassFolder #225

willem-pennings opened this issue Nov 30, 2023 · 1 comment

Comments

@willem-pennings
Copy link

Due to some kind of Git quirk, I sometimes end up with empty directories in my MATLAB file tree. They could be class directories, like @Test. It turns out that if this is the case, building the documentation fails with a very vague error which I had been scratching my head over for quite some time now:

Extension error (sphinxcontrib.matlab):
Handler <function analyze at 0x000002A1322DE340> for event 'builder-inited' threw an exception (exception: )

I usually build using make html but when running using sphinx-build the verbosity is better and I found out that this error is due to the assertion in mat_types.py:254:

Traceback (most recent call last):
  File "C:\...\.venv\Lib\site-packages\sphinx\events.py", line 97, in emit
    results.append(listener.handler(self.app, *args))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\...\.venv\Lib\site-packages\sphinxcontrib\matlab.py", line 844, in analyze
    mat_types.analyze(app)
  File "C:\...\.venv\Lib\site-packages\sphinxcontrib\mat_types.py", line 254, in analyze
    assert len(class_entities) == 1
AssertionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\...\.venv\Lib\site-packages\sphinx\cmd\build.py", line 293, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\...\.venv\Lib\site-packages\sphinx\application.py", line 272, in __init__
    self._init_builder()
  File "C:\...\.venv\Lib\site-packages\sphinx\application.py", line 343, in _init_builder
    self.events.emit('builder-inited')
  File "C:\...\.venv\Lib\site-packages\sphinx\events.py", line 108, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function analyze at 0x000001FBDA819C60> for event 'builder-inited' threw an exception (exception: )

I can imagine that others might run into this issue, too, so is it perhaps an idea to handle this situation?

@joeced
Copy link
Collaborator

joeced commented Dec 10, 2023

Sorry for the late reply.

I have observed several issues of this kind after the update related to this update (2cf37c3).

I will look into it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants