diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-11-24 18:19:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-24 18:19:59 +0100 |
commit | c495dfb9c38fd1944490f46b8e854f010aeaa238 (patch) | |
tree | 059503d5473c879e34cee4047d3765e50e4759e9 /hwdb/parse_hwdb.py | |
parent | bbe16abb611d05c4aba255433f061bdce8c321ac (diff) | |
parent | 30dc7898d5a0311a88f069e39e7ff552b3fc3190 (diff) |
Merge pull request #4729 from martinpitt/hwdb
fix hwdb syntax error and add test for it
Diffstat (limited to 'hwdb/parse_hwdb.py')
-rwxr-xr-x | hwdb/parse_hwdb.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py index 5d4c5ea64d..556b859191 100755 --- a/hwdb/parse_hwdb.py +++ b/hwdb/parse_hwdb.py @@ -133,7 +133,8 @@ def convert_properties(group): def parse(fname): grammar = hwdb_grammar() try: - parsed = grammar.parseFile(fname) + with open(fname, 'r', encoding='UTF-8') as f: + parsed = grammar.parseFile(f) except ParseBaseException as e: error('Cannot parse {}: {}', fname, e) return [] |