Commit 7b8998e5 authored by Mattia Rizzolo's avatar Mattia Rizzolo

comparators.json: fix UnicodeDecodeError with a non-UTF8 locale.

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <>
parent 8fbd7e3f
......@@ -33,7 +33,7 @@ except ImportError: # noqa
class JSONFile(File):
def recognizes(cls, file):
with open(file.path) as f:
with open(file.path, 'rb') as f:
# Try fuzzy matching for JSON files
is_text = any(
......@@ -41,7 +41,7 @@ class JSONFile(File):
if is_text and not'.json'):
buf =
if not any(x in buf for x in '{['):
if not any(x in buf for x in b'{['):
return False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment