From d4ba19eeeb456c08d9523e25456beda3980c8dea Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Feb 2024 11:58:00 -0500 Subject: [PATCH] Add explicit encoding in towncrier.create. --- src/towncrier/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/towncrier/create.py b/src/towncrier/create.py index 5242e124..c59e0a7f 100644 --- a/src/towncrier/create.py +++ b/src/towncrier/create.py @@ -138,7 +138,7 @@ def __main( ctx.exit(1) content = edited_content - with open(segment_file, "w") as f: + with open(segment_file, "w", encoding="utf-8") as f: f.write(content) click.echo(f"Created news fragment at {segment_file}")