From a12881e2e4ffbce218802333a61612c508329074 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 25 Aug 2023 06:55:18 +0300 Subject: [PATCH] git-hooks/pre-commit-python.hook: Specify encoding for the open call Part-of: --- scripts/git-hooks/pre-commit-python.hook | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/git-hooks/pre-commit-python.hook b/scripts/git-hooks/pre-commit-python.hook index 15ed76566f..f97894be99 100755 --- a/scripts/git-hooks/pre-commit-python.hook +++ b/scripts/git-hooks/pre-commit-python.hook @@ -40,7 +40,7 @@ def copy_files_to_tmp_dir(files): filepath = os.path.dirname(filename) if not os.path.exists(filepath): os.makedirs(filepath) - with open(filename, 'w') as f: + with open(filename, 'w', encoding="utf-8") as f: system('git', 'show', ':' + name, stdout=f) return tempdir