Skip to content

hidtools: open file as utf-8

Breno Leitao requested to merge leitao/hid-tools:master into master

Specify that we are opening a file as utf-8, otherwise on an ASCII environment, we gan get the following error:

Traceback (most recent call last):
  File "hid-recorder", line 20, in <module>
    import hidtools.cli.record
  File "/home/foobar/hid-tools/hidtools/cli/record.py", line 25, in <module>
    from hidtools.hidraw import HidrawDevice
  File "/home/foobar/hid-tools/hidtools/hidraw.py", line 27, in <module>
    from hidtools.hid import ReportDescriptor
  File "/home/foobar/hid-tools/hidtools/hid.py", line 23, in <module>
    from hidtools.hut import HUT
  File "/home/foobar/hid-tools/hidtools/hut.py", line 409, in <module>
    HUT = HidUsageTable._from_hut_data()
  File "/home/foobar/hid-tools/hidtools/hut.py", line 400, in _from_hut_data
    usage_page = cls._parse_usages(f)
  File "/home/foobar/hid-tools/hidtools/hut.py", line 336, in _parse_usages
    for line in f:
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
697: ordinal not in range(128)

Signed-off-by: Breno Leitao leitao@debian.org

Merge request reports

Loading