read file in binary and replace encoding errors
This commit is contained in:
parent
b5f485bc5a
commit
7b861a42f5
@ -13,8 +13,8 @@ class UEventParser(configparser.ConfigParser):
|
||||
@staticmethod
|
||||
def parse_file(file):
|
||||
parser = UEventParser()
|
||||
with open(file, "r") as file:
|
||||
parser.read_string(file.read())
|
||||
with open(file, "rb") as file:
|
||||
parser.read_string(file.read().decode(errors="replace"))
|
||||
return dict(parser.items("id10t"))
|
||||
|
||||
def __init__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user