Closed denilsonsa closed 1 year ago
Thanks fo the patch. I shall raise an issue about adding more debugging.
I would like to support laptops by providing a wrapper around ddcutil that would support a subset of commands - see #44. But I don't own any laptops, maybe one day (probably not though).
There may be other uses of .decode()
that can throw the same error, but I haven't investigated any further.
There may be other uses of
.decode()
that can throw the same error, but I haven't investigated any further.
I will be looking at any other decode() calls.
I changed errors='replace'
to errors='surrogateescape'
in an attempt to retain as much info as possible. I've put this in place in almost every instance where decode is used.
In many cases decode is issued when creating diagnostics, leaving an escaped representation of the offending character should be safe. I'm sure about what will happen if a decoded surrogateescape value is used functionally, but I don't think that is likely to happen.
Fixed this error:
ERROR: 'utf-8' codec can't decode byte 0x80 in position 2818: invalid start byte
It happens because indeed there is a 0x80 byte in the middle of
Extra descriptor
at the EDID information. Look:This, by the way, is reported as Invalid display, because This is an eDP laptop display. Laptop displays do not support DDC/CI.
Bonus: Tracking down this error was annoying because the
try…except
block at line 6531 swallows the stacktrace. I managed to view the stacktrace by adding a plainraise
line in theexcept
block, effectively re-throwing the error. Maybe the stacktrace should be printed if--debug
is passed. I'll leave the implementation as an exercise to someone else. ;)