Skip to content

Sphinx v9.0 (RC) breaks theme #475

@2bndy5

Description

@2bndy5

Testing the sphinx 9.0.0-rc2 with this theme crashes with the following error:

Traceback
=========

      File "C:\dev\sphinx-immaterial\.venv\Lib\site-packages\sphinx\builders\__init__.py", line 427, in build
        pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL)
        ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    _pickle.PicklingError: Can't pickle local object <class 'sphinx_immaterial._get_html_builder.<locals>.CustomHTMLBuilder'>
    when serializing dict item '_builder_cls'
    when serializing sphinx.environment.BuildEnvironment state
    when serializing sphinx.environment.BuildEnvironment object

It seems the changes in sphinx v9.0 no longer like our dynamic HTML Builder class (declarated in function body). After moving the class definition outside the function body, it complained about our custom node visitor (which is also defined in a function body):

Traceback
=========

      File "C:\dev\sphinx-immaterial\.venv\Lib\site-packages\sphinx\transforms\post_transforms\__init__.py", line 352, in run
        if issubclass(translator, SphinxTranslator):
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: issubclass() arg 1 must be a class

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions