Skip to content

AttributeError: 'PosixPath' object has no attribute 'rstrip' in breathe/project.py #944

@olivierbichler-cea

Description

@olivierbichler-cea

Hi,

I recently got the following error during Sphinx compilation. Everything was working fine a month ago.

Python version: 3.10.12
Sphinx version: 7.2.2

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/sphinx/cmd/build.py", line 293, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/sphinx/application.py", line 233, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/sphinx/application.py", line 406, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/sphinx/registry.py", line 460, in load_extension
    metadata = setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/breathe/__init__.py", line 12, in setup
    directive_setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/breathe/directives/setup.py", line 61, in setup
    project_info_factory = ProjectInfoFactory(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/breathe/project.py", line 116, in __init__
    self._default_build_dir = os.path.dirname(app.doctreedir.rstrip(os.sep))
AttributeError: 'PosixPath' object has no attribute 'rstrip'

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/eclipse-aidge/envs/latest/lib/python3.10/site-packages/breathe/project.py", line 116, in __init__
    self._default_build_dir = os.path.dirname(app.doctreedir.rstrip(os.sep))
AttributeError: 'PosixPath' object has no attribute 'rstrip'

Do you have any clue on how to solve this?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions