[BUG] Crash when connecting/disconnecting power adapter
See original GitHub issueDescribe the bug
When running bpytop on Debian Testing and with the battery-mode enabled, bpytop crashes when I connect or disconnect my power adapter.
Info (please complete the following information):
- bpytop version: 1.0.27
- psutil version: 5.7.2
- (Linux) Linux distribution and version: Debian Testing
- Terminal used: zsh
- Python version: 3.8.5
Additional context
contents of ~/.config/bpytop/error.log
12/09/20 (13:16:48) | INFO: New instance of bpytop version 1.0.27 started with pid 297438
12/09/20 (13:16:48) | INFO: Loglevel set to INFO
12/09/20 (13:17:32) | ERROR: Data collection thread failed with exception: 'NoneType' object has no attribute 'percent'
Traceback (most recent call last):
File "/usr/local/bin/bpytop", line 2503, in _runner
collector._draw()
File "/usr/local/bin/bpytop", line 2705, in _draw
CpuBox._draw_fg()
File "/usr/local/bin/bpytop", line 1636, in _draw_fg
if CONFIG.show_battery and cls.battery_present and psutil.sensors_battery().percent != cls.battery_percent:
AttributeError: 'NoneType' object has no attribute 'percent'
12/09/20 (13:17:33) | WARNING: Exiting with errorcode (1). Runtime 0:00:45
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Laptop crashes when power cord is unplugged
Almost every time when I unplug power cord and I have open program my laptop freezes for about 3-4 seconds then it comes...
Read more >Windows crashed after charger disconnecte…
Once I unplug and disconnects the charger from my laptop and tries to use the Battery, for some reason. Windows not responding and...
Read more >Windows 10 crashes when laptop is connected to charger
Unplug the AC power adapter. Press and hold the Power button down for 15 seconds. This will perform a software battery reset that...
Read more >Laptop crashes when power cord is unplugged - Windows 7
Whenever I unplug the power cord, laptops were crashing with blue screen. Issue was not resolved even after updating the graphics driver.
Read more >Laptop crashes and restarts after unplugging charger
Laptop simply crashes whenever I unplug the charger. Upon restart, windows says it encountered an error, blah blah blah, would - 4605574.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, just noticed from psutil documentation:
Will add a check to hide if the value is negative.
@delta-one Fixed in v1.0.30 Hopefully last fix for this 😃