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
|
@staticmethod
|
||||||
def parse_file(file):
|
def parse_file(file):
|
||||||
parser = UEventParser()
|
parser = UEventParser()
|
||||||
with open(file, "r") as file:
|
with open(file, "rb") as file:
|
||||||
parser.read_string(file.read())
|
parser.read_string(file.read().decode(errors="replace"))
|
||||||
return dict(parser.items("id10t"))
|
return dict(parser.items("id10t"))
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user