@@ -676,7 +676,7 @@ def render(
676676 # Render new entries in-place.
677677 if in_place :
678678 # Read current changelog lines.
679- with open (output ) as changelog_file : # type: ignore[arg-type]
679+ with open (output , encoding = "utf8" ) as changelog_file : # type: ignore[arg-type]
680680 lines = changelog_file .read ().splitlines ()
681681
682682 # Prepare version regex and marker line.
@@ -720,7 +720,7 @@ def render(
720720 lines [marker : marker + marker2 + 2 ] = [rendered ]
721721
722722 # Write back updated changelog lines.
723- with open (output , "w" ) as changelog_file : # type: ignore[arg-type]
723+ with open (output , "w" , encoding = "utf8" ) as changelog_file : # type: ignore[arg-type]
724724 changelog_file .write ("\n " .join (lines ).rstrip ("\n " ) + "\n " )
725725
726726 # Overwrite output file.
@@ -731,7 +731,7 @@ def render(
731731 if output is sys .stdout :
732732 sys .stdout .write (rendered )
733733 else :
734- with open (output , "w" ) as stream : # type: ignore[arg-type]
734+ with open (output , "w" , encoding = "utf8" ) as stream : # type: ignore[arg-type]
735735 stream .write (rendered )
736736
737737 return rendered
@@ -840,7 +840,7 @@ def get_release_notes(
840840 release_notes = []
841841 found_marker = False
842842 found_version = False
843- with open (input_file ) as changelog :
843+ with open (input_file , encoding = "utf8" ) as changelog :
844844 for line in changelog :
845845 line = line .strip () # noqa: PLW2901
846846 if not found_marker :
0 commit comments