From f7996209fedf74e351dfefeecb1e3c7e5a7f747a Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Fri, 19 Jun 2026 09:11:54 -0400 Subject: [PATCH] Enforce UTF-8 encoding on file opens --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index fa95b63c..c5258231 100755 --- a/setup.py +++ b/setup.py @@ -150,11 +150,11 @@ def edit_release_notes(): fd, tmp = mkstemp(prefix='bumpversion-') try: os.close(fd) - with open(tmp, 'w') as f: + with open(tmp, 'w', encoding='utf-8') as f: f.write("\n\n# Write release notes.\n" "# Lines starting with '#' will be ignored.") subprocess.check_call(text_editor + [tmp]) - with open(tmp, 'r') as f: + with open(tmp, 'r', encoding='utf-8') as f: changes = "".join( l for l in f.readlines() if not l.startswith('#')) finally: @@ -175,7 +175,7 @@ def run(self): "release", tag=True, message=self.message, allow_dirty=dirty) -with open('README.rst', 'r') as f: +with open('README.rst', 'r', encoding='utf-8') as f: long_description = f.read()