Skip to content

AttributeError: 'MkdocsPageSubset' object has no attribute 'file'. Did you mean: 'title'? #404

@vedranmiletic

Description

@vedranmiletic

When running with Material for MkDocs 9.7.0, I get the following trace:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.14.0/x64/bin/mkdocs", line 7, in <module>
    sys.exit(cli())
             ~~~^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/click/core.py", line 1462, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/click/core.py", line 1383, in main
    rv = self.invoke(ctx)
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/click/core.py", line 1850, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/click/core.py", line 1246, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/click/core.py", line 814, in invoke
    return callback(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs/__main__.py", line 288, in build_command
    build.build(cfg, dirty=not clean)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs/commands/build.py", line 347, in build
    config.plugins.on_post_build(config=config)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs/plugins.py", line 602, in on_post_build
    return self.run_event('post_build', config=config)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs/plugins.py", line 568, in run_event
    result = method(**kwargs)
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs_rss_plugin/plugin.py", line 405, in on_post_build
    self.util.load_images_for_pages(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self.feed_created.entries, config.site_url, processed_refs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs_rss_plugin/util.py", line 575, in load_images_for_pages
    page_info.image = self.get_image(
                      ~~~~~~~~~~~~~~^
        in_page=page_info._mkdocs_page_ref, base_url=base_url
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs_rss_plugin/util.py", line 622, in get_image
    elif img_local_build_path := self.social_cards.get_social_card_build_path_for_page(
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        mkdocs_page=in_page
        ^^^^^^^^^^^^^^^^^^^
    ):
    ^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs_rss_plugin/integrations/theme_material_social_plugin.py", line 282, in get_social_card_build_path_for_page
    and self.integration_material_blog.is_page_a_blog_post(mkdocs_page)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/mkdocs_rss_plugin/integrations/theme_material_blog_plugin.py", line 143, in is_page_a_blog_post
    return Path(mkdocs_page.file.src_uri).is_relative_to(
                ^^^^^^^^^^^^^^^^
AttributeError: 'MkdocsPageSubset' object has no attribute 'file'. Did you mean: 'title'?

I got this in the action run for gaseri/website, which previously worked fine (i.e. with older version of Material for MkDocs).

I don't have time to debug this further right now, but I can try to produce a minimal non-working example soon if that would be useful.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions