Skip to content

Commit f5f087a

Browse files
committed
Use pathlib.
1 parent cddba20 commit f5f087a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

build_docs.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,11 @@ def build_sitemap(www_root: Path, group):
520520
return
521521
with open(HERE / "templates" / "sitemap.xml", encoding="UTF-8") as template_file:
522522
template = jinja2.Template(template_file.read())
523-
with open(www_root / "sitemap.xml", "w", encoding="UTF-8") as sitemap_file:
524-
sitemap_file.write(
525-
template.render(languages=LANGUAGES, versions=VERSIONS) + "\n"
526-
)
523+
sitemap_file = www_root / "sitemap.xml"
524+
sitemap_file.write_text(
525+
template.render(languages=LANGUAGES, versions=VERSIONS) + "\n",
526+
encoding="UTF-8"
527+
)
527528
sitemap_file.chmod(0o664)
528529
run(["chgrp", group, sitemap_file])
529530

0 commit comments

Comments
 (0)