Closed shamblett closed 2 years ago
+1
Seeing this on Arch as well.
Seeing this on macOS 11.6.1, with bpytop 1.0.67 installed through Homebrew.
The problem comes from distutils.utils
, from which strtobool
is imported and used only once.
Per PEP 632:
For these functions, and any others not mentioned here, you will need to reimplement the functionality yourself. The legacy documentation can be found at https://docs.python.org/3.9/distutils/apiref.html [...]
distutils.util.strtobool
The solution is to implement the functionality described here. Something like:
def strtobool(val):
try:
if val.lower() in ['y', 'yes', 't', 'true', 'on', '1']:
return True
elif val.lower() in ['n', 'no', 'f', 'false', 'off', '0']:
return False
except:
raise ValueError(f"invalid type {type(val)} for truth value {val}")
else:
raise ValueError(f"invalid truth value {val}")
(note that the .lower()
is not documented, but strtobool
does accept the capitalized versions of the flags as True or False, and throws an error when called on something else than a str
)
The utility works great on stock Fedora 35 however when I exit I get this message -