canonical / ubuntu-cloud-docs

Public Docs for Ubuntu in the Clouds
19 stars 46 forks source link

Bug fix for sphinx related build errors. #264

Closed k-dimple closed 3 months ago

k-dimple commented 3 months ago

Sample error:

copying images... [100%] all-clouds-how-to/check-cve-on-instance-images/0_oscap_oval_cve_scan_report.png Exception occurred:
  File "/xxx/ubuntu-cloud-docs/.sphinx/venv/lib/python3.10/site-packages/sphinx/builders/html/__init__.py", line 780, in copy_image_files
    self.srcdir / src, err)
TypeError: unsupported operand type(s) for /: 'str' and 'str'

Occurs when sphinx-multiproject extension is used and images are included in .rst files

Fix: Latest version of Sphinx expects 'srcdir' to be a Path, but the multiproject extension updates and returns 'srcdir' as a str.

A personal (temporary) fork of the multiproject extension was created with the required change and that is now specified in the custom_config.py as the extension to be used (instead of sphinx-multiproject). This will be reverted once the upstream multiproject extension is corrected.