-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Default encoding for JSON is UTF8 https://datatracker.ietf.org/doc/html/rfc7159#section-8.1
If you pass a file containing unicode chars to dollar_ref it will fail:
/usr/local/lib/python3.6/dist-packages/dollar_ref/__init__.py:166: in resolve_file
--
51 | file_data = read_file(path)
52 | /usr/local/lib/python3.6/dist-packages/dollar_ref/__init__.py:197: in read_file
53 | raw = file.read()
54 | /usr/lib/python3.6/encodings/ascii.py:26: in decode
55 | return codecs.ascii_decode(input, self.errors)[0]
56 | E UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 30017: ordinal not in range(128)
I guess the call to open needs encoding="utf8" here: https://github.com/bagrat/dollar-ref/blob/master/dollar_ref/__init__.py#L196
Metadata
Metadata
Assignees
Labels
No labels