[BUG] Crash when bpytop started with closed STDIN
See original GitHub issueDescribe the bug
bpytop crashes when started after installation with PackageKit command-not-found wrapper. I see this error in the console:
Traceback (most recent call last):
File "/usr/bin/bpytop", line 5411, in <module>
main()
File "/usr/bin/bpytop", line 5293, in main
Term.echo(False)
File "/usr/bin/bpytop", line 651, in echo
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(sys.stdin.fileno())
termios.error: (25, 'Inappropriate ioctl for device')
To Reproduce
- Remove
bpytop
with package manager; - Run
/usr/libexec/pk-command-not-found bpytop
and install bpytop again; - Crash.
Expected behavior
No crash.
Info (please complete the following information):
- bpytop version: 1.0.59
- psutil version: 5.7.2
- Linux distribution and version: Fedora 33 x86_64
- Terminal used: konsole
- Font used: JetBrains Mono NL
- Python version: 3.9.1
Additional context
17/08/20 (00:32:44) | ERROR: Non fatal error during disk io collection!
17/08/20 (00:32:44) | ERROR: Caused by outdated psutil version.
17/08/20 (00:32:44) | ERROR: not sure how to interpret line ' 8 0 sda 389 0 14192 243 0 0 0 0 0 252 243 0 0 0 0 0 0\n'
Traceback (most recent call last):
File "/usr/bin/bpytop", line 2697, in _collect
io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == "Linux" else False, nowrap=True)
File "/usr/lib64/python3.8/site-packages/psutil/__init__.py", line 2168, in disk_io_counters
rawdict = _psplatform.disk_io_counters(**kwargs)
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1125, in disk_io_counters
for entry in gen:
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1098, in read_procfs
raise ValueError("not sure how to interpret line %r" % line)
ValueError: not sure how to interpret line ' 8 0 sda 389 0 14192 243 0 0 0 0 0 252 243 0 0 0 0 0 0\n'
06/09/20 (19:48:59) | WARNING: psutil version 5.6.7 detected, version 5.7.0 or later required for full functionality!
06/09/20 (19:49:07) | ERROR: Non fatal error during disk io collection!
06/09/20 (19:49:07) | ERROR: Caused by outdated psutil version.
06/09/20 (19:49:07) | ERROR: not sure how to interpret line ' 8 0 sda 515 0 14262 426 0 0 0 0 0 518 426 0 0 0 0 0 0\n'
Traceback (most recent call last):
File "/usr/bin/bpytop", line 2716, in _collect
io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == "Linux" else False, nowrap=True)
File "/usr/lib64/python3.8/site-packages/psutil/__init__.py", line 2168, in disk_io_counters
rawdict = _psplatform.disk_io_counters(**kwargs)
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1125, in disk_io_counters
for entry in gen:
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1098, in read_procfs
raise ValueError("not sure how to interpret line %r" % line)
ValueError: not sure how to interpret line ' 8 0 sda 515 0 14262 426 0 0 0 0 0 518 426 0 0 0 0 0 0\n'
06/09/20 (19:50:10) | WARNING: psutil version 5.6.7 detected, version 5.7.0 or later required for full functionality!
06/09/20 (19:50:18) | ERROR: Non fatal error during disk io collection!
06/09/20 (19:50:18) | ERROR: Caused by outdated psutil version.
06/09/20 (19:50:18) | ERROR: not sure how to interpret line ' 8 0 sda 515 0 14262 426 0 0 0 0 0 518 426 0 0 0 0 0 0\n'
Traceback (most recent call last):
File "/usr/bin/bpytop", line 2716, in _collect
io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == "Linux" else False, nowrap=True)
File "/usr/lib64/python3.8/site-packages/psutil/__init__.py", line 2168, in disk_io_counters
rawdict = _psplatform.disk_io_counters(**kwargs)
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1125, in disk_io_counters
for entry in gen:
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1098, in read_procfs
raise ValueError("not sure how to interpret line %r" % line)
ValueError: not sure how to interpret line ' 8 0 sda 515 0 14262 426 0 0 0 0 0 518 426 0 0 0 0 0 0\n'
06/09/20 (19:51:44) | WARNING: psutil version 5.6.7 detected, version 5.7.0 or later required for full functionality!
06/09/20 (19:51:51) | ERROR: Non fatal error during disk io collection!
06/09/20 (19:51:51) | ERROR: Caused by outdated psutil version.
06/09/20 (19:51:51) | ERROR: not sure how to interpret line ' 8 0 sda 515 0 14262 426 0 0 0 0 0 518 426 0 0 0 0 0 0\n'
Traceback (most recent call last):
File "/usr/bin/bpytop", line 2716, in _collect
io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == "Linux" else False, nowrap=True)
File "/usr/lib64/python3.8/site-packages/psutil/__init__.py", line 2168, in disk_io_counters
rawdict = _psplatform.disk_io_counters(**kwargs)
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1125, in disk_io_counters
for entry in gen:
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1098, in read_procfs
raise ValueError("not sure how to interpret line %r" % line)
ValueError: not sure how to interpret line ' 8 0 sda 515 0 14262 426 0 0 0 0 0 518 426 0 0 0 0 0 0\n'
07/09/20 (15:53:12) | WARNING: psutil version 5.6.7 detected, version 5.7.0 or later required for full functionality!
07/09/20 (15:53:13) | ERROR: Non fatal error during disk io collection!
07/09/20 (15:53:13) | ERROR: Caused by outdated psutil version.
07/09/20 (15:53:13) | ERROR: not sure how to interpret line ' 8 0 sda 445 0 14262 309 0 0 0 0 0 352 309 0 0 0 0 0 0\n'
Traceback (most recent call last):
File "/usr/bin/bpytop", line 2716, in _collect
io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == "Linux" else False, nowrap=True)
File "/usr/lib64/python3.8/site-packages/psutil/__init__.py", line 2168, in disk_io_counters
rawdict = _psplatform.disk_io_counters(**kwargs)
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1125, in disk_io_counters
for entry in gen:
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1098, in read_procfs
raise ValueError("not sure how to interpret line %r" % line)
ValueError: not sure how to interpret line ' 8 0 sda 445 0 14262 309 0 0 0 0 0 352 309 0 0 0 0 0 0\n'
07/09/20 (15:53:30) | WARNING: psutil version 5.6.7 detected, version 5.7.0 or later required for full functionality!
07/09/20 (15:53:32) | ERROR: Non fatal error during disk io collection!
07/09/20 (15:53:32) | ERROR: Caused by outdated psutil version.
07/09/20 (15:53:32) | ERROR: not sure how to interpret line ' 8 0 sda 445 0 14262 309 0 0 0 0 0 352 309 0 0 0 0 0 0\n'
Traceback (most recent call last):
File "/usr/bin/bpytop", line 2716, in _collect
io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == "Linux" else False, nowrap=True)
File "/usr/lib64/python3.8/site-packages/psutil/__init__.py", line 2168, in disk_io_counters
rawdict = _psplatform.disk_io_counters(**kwargs)
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1125, in disk_io_counters
for entry in gen:
File "/usr/lib64/python3.8/site-packages/psutil/_pslinux.py", line 1098, in read_procfs
raise ValueError("not sure how to interpret line %r" % line)
ValueError: not sure how to interpret line ' 8 0 sda 445 0 14262 309 0 0 0 0 0 352 309 0 0 0 0 0 0\n'
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
[BUG] Crashed with mouse click and drag · Issue #147 - GitHub
Describe the bug. bpytop running in a tmux pane. Runs fine, but when mouse is clicked and dragged it crashes with error. To...
Read more >Issue 7111: abort when stderr is closed - Python tracker
Under Python 2.x, you don't get a crash but the behaviour is quite unhelpful ... If we want to allow for closed {stdin,...
Read more >Python crashing at `input(...)` after reading from STDIN
You have already read from stdin until end of file, but you could read from the terminal device: import sys print(len(sys.stdin.read())) ...
Read more >Xmobar doesn't appear unless I manually restart XMonad
Sometimes I notice that on initial startup, Xmobar shows up for a fraction of a second before disappearing completely (crash?) I have no...
Read more >Software Packages in "kinetic" - Ubuntu
... abacas (1.3.1-9) [universe]: close gaps in genomic alignments from short reads ... [universe]: tools for automatically reporting Apport crash reports ...
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
It can be crashed in bash with this command:
sys.stdin
will beNone
when STDIN is closed (I’m wrong aboutsys.stdin.fileno()
, not in this case).@aristocratos what you say about this check?