Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error with 2.0.0rc2: AttributeError("'str' object has no attribute 'attributes'") #1522

@lazka

Description

@lazka

Problem

Theme error:
An error happened in rendering the page api/aac.
Reason: AttributeError("'str' object has no attribute 'attributes'")

With verbose logs:

Traceback (most recent call last):
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/sphinx/builders/html/__init__.py", line 1098, in handle_page
    output = self.templates.render(templatename, ctx)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/sphinx/jinja2glue.py", line 196, in render
    return self.environment.get_template(template).render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/sphinx_rtd_theme/layout.html", line 36, in top-level template code
    {{ css_tag(cssfile) }}
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/jinja2/sandbox.py", line 393, in call
    return __context.call(__obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lazka/.cache/pypoetry/virtualenvs/mutagen-z6FbeZMH-py3.11/lib/python3.11/site-packages/sphinx/builders/html/__init__.py", line 1197, in css_tag
    for key in sorted(css.attributes):
                      ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'attributes'

Reproducible Project

https://github.com/quodlibet/mutagen/tree/main/docs

Expected Results

the docs build

Environment Info

  • Python Version: 3.11.5
  • Sphinx Version: 6.2.1
  • RTD Theme Version: 2.0.0rc2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions