replace() argument 1 must be str, not _StrPath

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: Ic8936c2e657a2a0212b1bc96915ba6e2035569b3
This commit is contained in:
Sean Mooney 2023-09-11 17:10:28 +01:00
parent 47845a267d
commit 39c91027a6
1 changed files with 2 additions and 1 deletions

View File

@ -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(' ')