wolfc01 / procexp

Process explorer for linux
GNU General Public License v3.0
97 stars 21 forks source link

Program won't start, error: "TypeError: a bytes-like object is required, not 'str'" [potential fix included] #19

Open TheOneWhoseUsernameWasTaken opened 3 years ago

TheOneWhoseUsernameWasTaken commented 3 years ago

When trying to run this on Linux Mint 20.1, I get the following error:

Call to __main__
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
app created: '<PyQt5.QtWidgets.QApplication object at 0x7fb978c47a60>'
Traceback (most recent call last):
  File "./procexp.py", line 573, in <module>
    g_reader = procreader.reader.procreader(int(g_settings["updateTimer"]), int(g_settings["historySampleCount"]))
  File "/path/to/procexp-master/procreader/reader.py", line 194, in __init__
    for line in data[0].split("\n"):
TypeError: a bytes-like object is required, not 'str'

I'm by no means a Python expert, but it seems as though changing line 194 in procreader/reader.py from:

        for line in data[0].split("\n"):

to:

        for line in data[0].decode().split("\n"):

solves the issue. The program appears to start fine now. Just wanted to let you know. Thanks for your work on this!