Skip to content

RemovedInSphinx90Warning: string paths passed to Sphinx image registration API #110

@FredM67

Description

@FredM67

Description

With Sphinx >= 8.2.3 and sphinxcontrib-drawio 0.0.17, building documentation emits repeated RemovedInSphinx90Warning during the image copying phase:

copying images... [ 62%] sphinx/environment/adapters/asset.py:19: RemovedInSphinx90Warning: Sphinx 9 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
  while _StrPath(name) in self.env.original_image_uri:
sphinx/environment/adapters/asset.py:20: RemovedInSphinx90Warning: Sphinx 9 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
  name = self.env.original_image_uri[_StrPath(name)]

Environment

  • Python 3.12
  • Sphinx 8.2.3
  • sphinxcontrib-drawio 0.0.17

Expected behavior

No deprecation warnings during build.

Cause

It appears that sphinxcontrib-drawio registers images using string paths rather than pathlib.Path objects, which triggers Sphinx's deprecation warning ahead of the Sphinx 9 breaking change.

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