Skip to content

Commit

Permalink
Write stubs for C module with utf-8 encoding (#17367)
Browse files Browse the repository at this point in the history
Avoid encoding errors if functions contain non-ASCII characters.
  • Loading branch information
tadeu authored Jun 12, 2024
1 parent 415d49f commit 8fb9969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def generate_stub_for_c_module(
gen.generate_module()
output = gen.output()

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


Expand Down

0 comments on commit 8fb9969

Please sign in to comment.