From c7196d231c615d608d2229eeaa5e51dda07bc737 Mon Sep 17 00:00:00 2001 From: Matt Stone Date: Wed, 4 Mar 2026 08:46:49 -0800 Subject: [PATCH] fix: Specify UTF-8 encoding when opening output files Explicitly pass `encoding="utf-8"` in `MetricWriter.__init__` to avoid defaulting to the system encoding on Windows. Co-Authored-By: Rahul Kaushal --- fgmetric/metric_writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fgmetric/metric_writer.py b/fgmetric/metric_writer.py index 21de462..98aaa65 100644 --- a/fgmetric/metric_writer.py +++ b/fgmetric/metric_writer.py @@ -62,7 +62,7 @@ def __init__( lineterminator: The string used to terminate lines produced by the MetricWriter. """ self._metric_class = metric_class - self._fout = Path(filename).open("w") + self._fout = Path(filename).open("w", encoding="utf-8") try: self._writer = DictWriter(