From c63b2d2f871211a15f37cd2e13c32943919712ab Mon Sep 17 00:00:00 2001 From: Iniya <154033315+iniya-27@users.noreply.github.com> Date: Tue, 10 Nov 2026 17:25:18 +0530 Subject: [PATCH 1/2] Add UTF-8 encoding to file operations in update_switcher.py Updated file handling to specify UTF-8 encoding for reading and writing switcher.json. --- docs/update_switcher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/update_switcher.py b/docs/update_switcher.py index 0277eb4dcc..dbf2c05a29 100644 --- a/docs/update_switcher.py +++ b/docs/update_switcher.py @@ -8,7 +8,7 @@ import os -def main(): +def main() -> None: # Define CLI arguments parser = argparse.ArgumentParser(description="Update switcher.json") parser.add_argument( @@ -20,7 +20,7 @@ def main(): # Setup path to switcher.json (relative to this script) and load it switcher_path = os.path.join(os.path.dirname(__file__), "_static", "switcher.json") - with open(switcher_path) as f: + with open(switcher_path, encoding="utf-8") as f: switcher = json.load(f) # first we get the version number of the previous version @@ -54,7 +54,7 @@ def main(): switcher.insert(latest_index + 1, previous_version_entry) # Write the updated switcher.json - with open(switcher_path, "w") as f: + with open(switcher_path, "w", encoding="utf-8") as f: json.dump(switcher, f, indent=2) From 9f289e91da7bccd56f54551e8621abcb1a1e28bc Mon Sep 17 00:00:00 2001 From: Iniya <154033315+iniya-27@users.noreply.github.com> Date: Tue, 10 Nov 2026 17:28:46 +0530 Subject: [PATCH 2/2] Update update_switcher.py --- docs/update_switcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/update_switcher.py b/docs/update_switcher.py index dbf2c05a29..26dc0332dc 100644 --- a/docs/update_switcher.py +++ b/docs/update_switcher.py @@ -54,7 +54,7 @@ def main() -> None: switcher.insert(latest_index + 1, previous_version_entry) # Write the updated switcher.json - with open(switcher_path, "w", encoding="utf-8") as f: + with open(switcher_path, "w", encoding="utf-8") as f: json.dump(switcher, f, indent=2)