From 39ccb17db4a77d97705a164178242044e121bd2f Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Fri, 25 Oct 2024 12:32:50 +0100 Subject: [PATCH] [docs] replace() argument 1 must be str, not _StrPath This change ports Ic8936c2e657a2a0212b1bc96915ba6e2035569b3 from nova's specs repo to fix the redirect generation The type of app.builder.srcdir is now a _StrPath which breaks the invocation of replace when generating redirects. This change just fixes that by wrapping it in str() Change-Id: I123aec140d9871ad27e522c107edad40efaf2a19 --- doc/source/redirect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/redirect.py b/doc/source/redirect.py index c3a7ad2..a689c35 100644 --- a/doc/source/redirect.py +++ b/doc/source/redirect.py @@ -11,7 +11,8 @@ LOG = logging.getLogger(__name__) def process_redirect_file(app, path, ent): - parent_path = path.replace(app.builder.srcdir, app.builder.outdir) + parent_path = path.replace( + str(app.builder.srcdir), str(app.builder.outdir)) with open(os.path.join(path, ent)) as redirects: for line in redirects.readlines(): from_path, to_path = line.rstrip().split(' ')