From 6e8d81e28e8083f5675448382c7cfaf2f9b681ea Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sat, 19 Aug 2023 19:01:07 +0800 Subject: [PATCH] Compat with Sphinx 7.2's changes ref: https://github.com/sphinx-doc/sphinx/pull/11526 --- src/sphinxnotes/lilypond/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sphinxnotes/lilypond/__init__.py b/src/sphinxnotes/lilypond/__init__.py index 3cbf1af..77ed5c0 100644 --- a/src/sphinxnotes/lilypond/__init__.py +++ b/src/sphinxnotes/lilypond/__init__.py @@ -359,7 +359,10 @@ def read_source_file(env:BuildEnvironment, fn:str) -> str: """ if path.isabs(fn): # Source dir absolute path to file system absolute path. - fn = env.srcdir + fn + # + # Since Sphinx 7.2, env.srcdir changes its type from str to pathlib.Path. + # See https://github.com/sphinx-doc/sphinx/pull/11526. TODO: use pathlib + fn = path.join(str(env.srcdir), fn) else: # Document relative path to file system absolute path. fn = path.join(path.dirname(env.doc2path(env.docname)), fn)