mirror of
https://github.com/scito/extract_otp_secrets.git
synced 2025-12-24 02:59:46 +01:00
6
utils.py
6
utils.py
@@ -59,7 +59,7 @@ def remove_dir_with_files(dir):
|
||||
|
||||
def read_csv(filename):
|
||||
"""Returns a list of lines."""
|
||||
with open(filename, "r", newline='') as infile:
|
||||
with open(filename, "r", encoding="utf-8", newline='') as infile:
|
||||
lines = []
|
||||
reader = csv.reader(infile)
|
||||
for line in reader:
|
||||
@@ -78,7 +78,7 @@ def read_csv_str(str):
|
||||
|
||||
def read_json(filename):
|
||||
"""Returns a list or a dictionary."""
|
||||
with open(filename, "r") as infile:
|
||||
with open(filename, "r", encoding="utf-8") as infile:
|
||||
return json.load(infile)
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ def read_json_str(str):
|
||||
|
||||
def read_file_to_list(filename):
|
||||
"""Returns a list of lines."""
|
||||
with open(filename, "r") as infile:
|
||||
with open(filename, "r", encoding="utf-8") as infile:
|
||||
return infile.readlines()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user