Skip to content

Commit

Permalink
fix(general): fix print to encode in windows (#5572)
Browse files Browse the repository at this point in the history
  • Loading branch information
omryMen authored Sep 20, 2023
1 parent 74dc72b commit 234ec76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion checkov/common/runners/runner_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import logging
import os
import re
import platform
import sys

from collections import defaultdict
from collections.abc import Iterable
Expand Down Expand Up @@ -603,7 +605,10 @@ def _print_to_console(self, output_formats: dict[str, str], output_format: str,
if output_dest == CONSOLE_OUTPUT:
del output_formats[output_format]

print(output)
if platform.system() == 'Windows':
sys.stdout.buffer.write(output.encode("utf-8"))
else:
print(output)
if url:
print(f"More details: {url}")

Expand Down

0 comments on commit 234ec76

Please sign in to comment.