we need a check to avoid the .encode('utf8') if d.value is a bytes object.
I'm not sure if d.value can not be a bytes object at that point, after a failed decode() (so whether the else branch ever gets visited), I only trust the writer of the former version who tried to d.value.encode(), from which I deduce that at it is possible sometimes (therefore, sometimes d.value is not bytes).
https://github.com/ActivityWatch/aw-watcher-window/issues/21
I'm not sure if
d.value
can not be a bytes object at that point, after a faileddecode()
(so whether theelse
branch ever gets visited), I only trust the writer of the former version who tried tod.value.encode()
, from which I deduce that at it is possible sometimes (therefore, sometimesd.value
is not bytes).