mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 21:11:53 +00:00
fix(encoding): set utf-8 encoding for csv (#3961)
This commit is contained in:
+1
-6
@@ -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"
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user