d4nj1 / TLPUI

A GTK user interface for TLP written in Python
GNU General Public License v2.0
1.08k stars 83 forks source link

Statistics Complete on Bookwork fails with error #117

Closed markd89 closed 1 year ago

markd89 commented 1 year ago

Hi, I built this on Debian Bookworm and ran it from a terminal sudo tlpui

I click Statistics, Complete and see the following in the terminal window:


Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/tlpui/statui.py", line 26, in fetch_complete_stats
    tlp_stat_output = settingshelper.exec_command([sudo_cmd, "tlp-stat"])
  File "/usr/lib/python3/dist-packages/tlpui/settingshelper.py", line 15, in exec_command
    return check_output(commands).decode(sys.stdout.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 13498: invalid continuation byte
d4nj1 commented 1 year ago

Hi, it seems that the tlp and tlp-stat executables are not in the expected locations for bookworm. It might be that they are located in /usr/sbin or somewhere not accessible by tlpui. Can you please share the output of:

which tlp

and

which tlp-stat

Thanks in advance

d4nj1 commented 1 year ago

Hi, I updated the check scripts to also look into /usr/sbin when not found with which. This probably affects mostly bookworm and distros that put tlp in /usr/sbin.

Please try out latest master or https://github.com/d4nj1/TLPUI/tree/tlpui-1.5.0-6 and report back.

markd89 commented 1 year ago

Thank you, tried the master and confirmed fixed!