|
3 | 3 | """ |
4 | 4 |
|
5 | 5 | from abc import ABC, abstractmethod |
6 | | -from curses.ascii import isspace |
7 | 6 | import json |
8 | 7 | from pathlib import Path |
9 | 8 | import os |
@@ -114,7 +113,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: |
114 | 113 | "--enable-error-code", |
115 | 114 | "deprecated", |
116 | 115 | ] |
117 | | - proc = run(command, stdout=PIPE, text=True) |
| 116 | + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") |
118 | 117 | lines = proc.stdout.split("\n") |
119 | 118 |
|
120 | 119 | # Add results to a dictionary keyed by the file name. |
@@ -174,7 +173,7 @@ def get_version(self) -> str: |
174 | 173 |
|
175 | 174 | def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: |
176 | 175 | command = [sys.executable, "-m", "pyright", ".", "--outputjson"] |
177 | | - proc = run(command, stdout=PIPE, text=True) |
| 176 | + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") |
178 | 177 | output_json = json.loads(proc.stdout) |
179 | 178 | diagnostics = output_json["generalDiagnostics"] |
180 | 179 |
|
@@ -253,7 +252,7 @@ def get_version(self) -> str: |
253 | 252 | return version |
254 | 253 |
|
255 | 254 | def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: |
256 | | - proc = run(["pyre", "check"], stdout=PIPE, text=True) |
| 255 | + proc = run(["pyre", "check"], stdout=PIPE, text=True, encoding="utf-8") |
257 | 256 | lines = proc.stdout.split("\n") |
258 | 257 |
|
259 | 258 | # Add results to a dictionary keyed by the file name. |
@@ -325,7 +324,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: |
325 | 324 | if not fi.endswith(".py"): |
326 | 325 | continue |
327 | 326 | options.tweak(input=fi) |
328 | | - with open(fi, "r") as test_file: |
| 327 | + with open(fi, "r", encoding="utf-8") as test_file: |
329 | 328 | src = test_file.read() |
330 | 329 | try: |
331 | 330 | analysis: pytype_analyze.Analysis = pytype_io.check_py( |
|
0 commit comments