add flake8-encoding plugin

This commit is contained in:
Willi Ballenthin
2023-07-06 19:42:57 +02:00
parent 3ad4de70bf
commit ff47270681
3 changed files with 3 additions and 2 deletions

View File

@@ -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)