From 0751cc3fdbe022fec808a0597146f065b80ebd01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADnez?= <28702884+jorgepiloto@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:53:16 +0200 Subject: [PATCH] fix: ensure app.builder.outdir is a Path object (#565) Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> --- doc/changelog.d/565.miscellaneous.md | 1 + src/ansys_sphinx_theme/search/fuse_search.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 doc/changelog.d/565.miscellaneous.md diff --git a/doc/changelog.d/565.miscellaneous.md b/doc/changelog.d/565.miscellaneous.md new file mode 100644 index 000000000..1313047c8 --- /dev/null +++ b/doc/changelog.d/565.miscellaneous.md @@ -0,0 +1 @@ +fix: ensure app.builder.outdir is a Path object \ No newline at end of file diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index c7b354571..4e6539ac5 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -23,6 +23,7 @@ """Module for generating search indices.""" import json +from pathlib import Path import re from docutils import nodes @@ -147,6 +148,6 @@ def create_search_index(app, exception): search_index.build_sections() search_index_list.extend(search_index.indices) - search_index_path = app.builder.outdir / "_static" / "search.json" + search_index_path = Path(app.builder.outdir) / "_static" / "search.json" with search_index_path.open("w", encoding="utf-8") as index_file: json.dump(search_index_list, index_file, ensure_ascii=False, indent=4)