mirror of
https://github.com/mandiant/capa.git
synced 2025-12-22 23:26:21 -08:00
add flake8-encoding plugin
This commit is contained in:
@@ -42,7 +42,7 @@ def get_features(rule_path: str) -> list:
|
||||
list: A list of all feature statements contained within the rule file.
|
||||
"""
|
||||
feature_list = []
|
||||
with open(rule_path, "r") as f:
|
||||
with open(rule_path, "r", encoding="utf-8") as f:
|
||||
try:
|
||||
new_rule = capa.rules.Rule.from_yaml(f.read())
|
||||
feature_list = get_child_features(new_rule.statement)
|
||||
|
||||
@@ -172,7 +172,7 @@ def main(args: argparse.Namespace) -> None:
|
||||
|
||||
logging.info(f"Writing results to {args.output}")
|
||||
try:
|
||||
with open(args.output, "w") as jf:
|
||||
with open(args.output, "w", encoding="utf-8") as jf:
|
||||
json.dump(data, jf, indent=2)
|
||||
except BaseException as e:
|
||||
logging.error(f"Exception encountered when writing results: {e}")
|
||||
|
||||
Reference in New Issue
Block a user