Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pydantic2ts/cli/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _clean_output_file(output_filename: str) -> None:
By rolling them all up into a single model, we can generate a single output file.
2. Add a banner comment with clear instructions for regenerating the typescript definitions.
"""
with open(output_filename, "r") as f:
with open(output_filename, "r", encoding="utf-8") as f:
lines = f.readlines()

start, end = None, None
Expand All @@ -233,7 +233,7 @@ def _clean_output_file(output_filename: str) -> None:

new_lines = banner_comment_lines + lines[:start] + lines[(end + 1) :]

with open(output_filename, "w") as f:
with open(output_filename, "w", encoding="utf-8") as f:
f.writelines(new_lines)


Expand Down