Skip to content

Commit d352cb8

Browse files
committed
fix: add encoding=utf-8 to subprocess.run in run_check_command
When text=True, subprocess.run uses the system default encoding (cp1252 on Windows) to encode stdin input. If commit messages contain Unicode characters outside cp1252 (e.g. ❌), the encoding fails with UnicodeEncodeError. The other two subprocess.run calls already had encoding='utf-8'.
1 parent 338036b commit d352cb8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎main.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def run_check_command(
165165
stdout=subprocess.PIPE,
166166
stderr=subprocess.STDOUT,
167167
text=True,
168+
encoding="utf-8",
168169
check=False,
169170
)
170171
if result.stdout:

0 commit comments

Comments
 (0)