Skip to content

Commit

Permalink
Make sure temp file uses utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Aug 30, 2024
1 parent d015b4e commit 8261acd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions djlint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ def main(
config.stdin = True
stdin_stream = click.get_text_stream("stdin", encoding="utf-8")
stdin_text = stdin_stream.read()
temp_file = tempfile.NamedTemporaryFile(delete=False) # noqa: SIM115
temp_file.write(stdin_text.encode("utf-8"))
temp_file = tempfile.NamedTemporaryFile( # noqa: SIM115
mode="w", encoding="utf-8", delete=False
)
temp_file.write(stdin_text)
temp_file.seek(0)

# cannot use gitignore for stdin paths.
Expand Down

0 comments on commit 8261acd

Please sign in to comment.