Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash at startup on Librem5 phone #266

Closed
nokernel opened this issue Feb 19, 2021 · 2 comments
Closed

Crash at startup on Librem5 phone #266

nokernel opened this issue Feb 19, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nokernel
Copy link

Describe the bug

On Librem5 phone with PureOS amber version.

Bpytop crash since quite a few versions, sorry I am vague, I allways postponed openning a bug report.

To Reproduce

bpytop is just crash at the end of startup

Expected behavior

No crash ;)

Info (please complete the following information):

  • bpytop version: 1.0.62
  • psutil version: 5.8.0 (version 5.7.0 or above is required)
  • (Linux) Linux distribution and version: PureOS amber-phone
  • Terminal used: ssh bash and local terminal
  • Font used: not sure how to get that
  • Python version: 3.8.6

Additional context

Here is the content of the error.log file

18/02/21 (19:21:08) | INFO: New instance of bpytop version 1.0.62 started with pid 3329
18/02/21 (19:21:08) | INFO: Loglevel set to DEBUG
18/02/21 (19:21:08) | DEBUG: Using psutil version 5.8.0
18/02/21 (19:21:08) | DEBUG: CMD: /home/purism/.asdf/installs/python/3.8.6/bin/bpytop --debug
18/02/21 (19:21:08) | INFO: Config file version and bpytop version missmatch, will be recreated on exit!
18/02/21 (19:21:14) | ERROR: Data collection thread failed with exception: unsupported operand type(s) for /: 'int' and 'bytes'
Traceback (most recent call last):
  File "/home/purism/.asdf/installs/python/3.8.6/lib/python3.8/site-packages/bpytop.py", line 2913, in _runner
    collector._draw()
  File "/home/purism/.asdf/installs/python/3.8.6/lib/python3.8/site-packages/bpytop.py", line 3205, in _draw
    CpuBox._draw_fg()
  File "/home/purism/.asdf/installs/python/3.8.6/lib/python3.8/site-packages/bpytop.py", line 1896, in _draw_fg
    if CONFIG.show_battery and cls.battery_activity():
  File "/home/purism/.asdf/installs/python/3.8.6/lib/python3.8/site-packages/bpytop.py", line 1816, in battery_activity
    if not hasattr(psutil, "sensors_battery") or psutil.sensors_battery() == None:
  File "/home/purism/.asdf/installs/python/3.8.6/lib/python3.8/site-packages/psutil/__init__.py", line 2288, in sensors_battery
    return _psplatform.sensors_battery()
  File "/home/purism/.asdf/installs/python/3.8.6/lib/python3.8/site-packages/psutil/_pslinux.py", line 1455, in sensors_battery
    secsleft = int(energy_now / power_now * 3600)
TypeError: unsupported operand type(s) for /: 'int' and 'bytes'
18/02/21 (19:21:14) | WARNING: Exiting with errorcode (1). Runtime 0:00:06```
@nokernel nokernel added the bug Something isn't working label Feb 19, 2021
@aristocratos
Copy link
Owner

@nokernel
Hi, the issue is happening in the psutil library, so you'll need to report it to https://github.com/giampaolo/psutil
The problem seems to be that your one of energy_now and power_now files that reports the battery status doesn't contain an integer value but a byte value.
Should be a easy fix by checking and converting the types before the calculation.

@nokernel
Copy link
Author

@nokernel
Hi, the issue is happening in the psutil library, so you'll need to report it to https://github.com/giampaolo/psutil
The problem seems to be that your one of energy_now and power_now files that reports the battery status doesn't contain an integer value but a byte value.
Should be a easy fix by checking and converting the types before the calculation.

Thanks I will go there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants