Skip to content

Commit 381d131

Browse files
committed
fix: specify utf-8 encoding in benchmark read_text for Windows CI
Windows defaults to cp1252 which can't decode some source file bytes.
1 parent fe39d40 commit 381d131

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/benchmarks/test_benchmark_libcst_multi_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _discover_all() -> None:
5050
"""Run discover_functions on all source files."""
5151
ps = PythonSupport()
5252
for file_path in _SOURCE_FILES:
53-
source = file_path.read_text()
53+
source = file_path.read_text(encoding="utf-8")
5454
ps.discover_functions(source=source, file_path=file_path)
5555

5656

tests/benchmarks/test_benchmark_libcst_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
def _run_pipeline() -> None:
2929
"""Simulate a single-file optimization pass through the full visitor pipeline."""
30-
source = _TARGET_FILE.read_text()
31-
source2 = _SECOND_FILE.read_text()
30+
source = _TARGET_FILE.read_text(encoding="utf-8")
31+
source2 = _SECOND_FILE.read_text(encoding="utf-8")
3232

3333
# 1. Discover functions (FunctionVisitor + MetadataWrapper)
3434
ps = PythonSupport()

0 commit comments

Comments
 (0)