git-hooks/pre-commit-python.hook: Specify encoding for the open call

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6652>
This commit is contained in:
Jordan Petridis 2023-08-25 06:55:18 +03:00 committed by GStreamer Marge Bot
parent 7b81d081ad
commit a12881e2e4

View file

@ -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