Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit54b6ce2

Browse files
authored
Conformance: fix issues running on Windows (#1969)
1 parentdde9ec4 commit54b6ce2

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

‎conformance/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To run the conformance test suite:
6060
* Switch to the`conformance` subdirectory and install all dependencies (`pip install -r requirements.txt`).
6161
* Switch to the`src` subdirectory and run`python main.py`.
6262

63-
Note that some type checkers may not run on some platforms.For example, pytype cannot be installed on Windows.If a type checker fails to install, tests will be skipped for that type checker.
63+
Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker.
6464

6565
##Reporting Conformance Results
6666

‎conformance/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ pyright
55
mypy
66
pip
77
pyre-check
8-
pytype;platform_system!="Windows"
8+
pytype

‎conformance/src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def f(): pass # E[final]
6767
{"final": [3, 4]}
6868
)
6969
"""
70-
withopen(test_case,"r")asf:
70+
withopen(test_case,"r",encoding="utf-8")asf:
7171
lines=f.readlines()
7272
output:dict[int,tuple[int,int]]= {}
7373
groups:dict[str,list[int]]= {}

‎conformance/src/type_checker.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
fromabcimportABC,abstractmethod
6-
fromcurses.asciiimportisspace
76
importjson
87
frompathlibimportPath
98
importos
@@ -114,7 +113,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
114113
"--enable-error-code",
115114
"deprecated",
116115
]
117-
proc=run(command,stdout=PIPE,text=True)
116+
proc=run(command,stdout=PIPE,text=True,encoding="utf-8")
118117
lines=proc.stdout.split("\n")
119118

120119
# Add results to a dictionary keyed by the file name.
@@ -174,7 +173,7 @@ def get_version(self) -> str:
174173

175174
defrun_tests(self,test_files:Sequence[str])->dict[str,str]:
176175
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")
178177
output_json=json.loads(proc.stdout)
179178
diagnostics=output_json["generalDiagnostics"]
180179

@@ -253,7 +252,7 @@ def get_version(self) -> str:
253252
returnversion
254253

255254
defrun_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")
257256
lines=proc.stdout.split("\n")
258257

259258
# 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]:
325324
ifnotfi.endswith(".py"):
326325
continue
327326
options.tweak(input=fi)
328-
withopen(fi,"r")astest_file:
327+
withopen(fi,"r",encoding="utf-8")astest_file:
329328
src=test_file.read()
330329
try:
331330
analysis:pytype_analyze.Analysis=pytype_io.check_py(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp