From a2a62118d1c30f0d03ebc819e83d4c6dc7188da8 Mon Sep 17 00:00:00 2001 From: Kelly Meleshko Date: Sat, 31 Jan 2026 12:39:07 +1100 Subject: [PATCH] Fix Windows UTF-8 decoding issues in sample JSON tests --- tests/integration/test_area_chart.py | 4 ++-- tests/integration/test_scatter_chart.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_area_chart.py b/tests/integration/test_area_chart.py index 91aec2e..c93a2b0 100644 --- a/tests/integration/test_area_chart.py +++ b/tests/integration/test_area_chart.py @@ -13,14 +13,14 @@ def load_sample_json(filename: str) -> dict: """Load a sample JSON file from tests/samples/area directory.""" samples_dir = Path(__file__).parent.parent / "samples" / "area" - with open(samples_dir / filename) as f: + with open(samples_dir / filename, encoding="utf-8") as f: return json.load(f) def load_sample_csv(filename: str) -> str: """Load a sample CSV file from tests/samples/area directory.""" samples_dir = Path(__file__).parent.parent / "samples" / "area" - with open(samples_dir / filename) as f: + with open(samples_dir / filename, encoding="utf-8") as f: return f.read() diff --git a/tests/integration/test_scatter_chart.py b/tests/integration/test_scatter_chart.py index 58bee71..a319b2d 100644 --- a/tests/integration/test_scatter_chart.py +++ b/tests/integration/test_scatter_chart.py @@ -13,7 +13,7 @@ def load_sample_json(filename: str) -> dict: """Load a sample JSON file from tests/samples/scatter/.""" path = Path(__file__).parent.parent / "samples" / "scatter" / filename - with open(path) as f: + with open(path, encoding="utf-8") as f: data = json.load(f) return data["chart"]["crdt"]["data"] @@ -22,7 +22,7 @@ def load_sample_csv(filename: str) -> str: """Load a sample CSV file from tests/samples/scatter/.""" path = Path(__file__).parent.parent / "samples" / "scatter" / filename # Read the file and convert tabs to commas if needed - with open(path) as f: + with open(path, encoding="utf-8") as f: content = f.read() # Check if this is a tab-delimited file if "\t" in content.split("\n")[0]: