Skip to content

Commit 8fb9969

Browse files
authored
Write stubs for C module with utf-8 encoding (#17367)
Avoid encoding errors if functions contain non-ASCII characters.
1 parent 415d49f commit 8fb9969

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/stubgenc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def generate_stub_for_c_module(
178178
gen.generate_module()
179179
output = gen.output()
180180

181-
with open(target, "w") as file:
181+
with open(target, "w", encoding="utf-8") as file:
182182
file.write(output)
183183

184184

0 commit comments

Comments
 (0)