diff --git a/scripts/generate_mkdocs.py b/scripts/generate_mkdocs.py index 48b4acce3c72e..d83fc62e117dd 100644 --- a/scripts/generate_mkdocs.py +++ b/scripts/generate_mkdocs.py @@ -108,7 +108,7 @@ def main() -> None: if not generated: continue - with Path(f"docs/{filename}").open("w+") as f: + with Path(f"docs/{filename}").open("w+", encoding="utf8") as f: if filename == "contributing.md": # Copy the CONTRIBUTING.md. shutil.copy("CONTRIBUTING.md", "docs/contributing.md") @@ -173,7 +173,7 @@ def main() -> None: # Add the nav section to mkdocs.yml. config["nav"] = [{section.title: section.filename} for section in SECTIONS] - with Path("mkdocs.generated.yml").open("w+") as fp: + with Path("mkdocs.generated.yml").open("w+", encoding="utf8") as fp: yaml.safe_dump(config, fp)