fix(encoding): set utf-8 encoding for csv (#3961)

This commit is contained in:
Pedro Martín
2024-05-08 13:14:47 +02:00
committed by GitHub
parent d35fd463a2
commit e226cb06e0
2 changed files with 2 additions and 7 deletions
+1 -6
View File
@@ -1,5 +1,4 @@
import os
import sys
# Emojis to be used in the compliance table
pass_emoji = ""
@@ -29,10 +28,6 @@ informational_color = "#3274d9"
folder_path_overview = os.getcwd() + "/output"
folder_path_compliance = os.getcwd() + "/output/compliance"
# Encoding, if the os is windows, use cp1252. Use utf-8 if it is running using python3
if os.name == "nt" and ".py" not in sys.argv[0].lower():
encoding_format = "cp1252"
else:
encoding_format = "utf-8"
encoding_format = "utf-8"
# Error action, it is recommended to use "ignore" or "replace"
error_action = "ignore"
+1 -1
View File
@@ -28,7 +28,7 @@ from prowler.lib.logger import logger
def open_file(input_file: str, mode: str = "r") -> TextIOWrapper:
"""open_file returns a handler to the file using the specified mode."""
try:
f = open(input_file, mode)
f = open(input_file, mode, encoding="utf-8")
except OSError as os_error:
if os_error.strerror == "Too many open files":
logger.critical(