cset set might fail with TypeError: unsupported operand type(s) for //: 'str' and 'int'
Closed this issue · 3 comments
przemekr commented
Running 'cset set' might result in:
bash-4.4# cset set
Traceback (most recent call last):
File "/usr/bin/cset", line 47, in <module>
main()
File "/usr/lib/python3.6/site-packages/cpuset/main.py", line 234, in main
command.func(parser, options, args)
File "/usr/lib/python3.6/site-packages/cpuset/commands/set.py", line 212, in func
else: list_sets('root', options.recurse, options.usehex)
File "/usr/lib/python3.6/site-packages/cpuset/commands/set.py", line 243, in list_sets
pl.append(set_details(s,' ', 78, usehex))
File "/usr/lib/python3.6/site-packages/cpuset/commands/set.py", line 487, in set_details
pathb = set.path[len(set.path//2):]
TypeError: unsupported operand type(s) for //: 'str' and 'int'
Should the code in set.py be updated like:
- pathb = set.path[len(set.path//2):]
+pathb = set.path[len(set.path)//2:]
?
meetesh06 commented
The issue happens for me when running
cset set -r
updating set.py as mentioned above fixes the issue.
MarkGotLasagna commented
Hi. I'm having the same issue. 'cpuset' was installed from Arch's AUR repository with 'yay'. Should I manually change the source myself as suggested?
Traceback (most recent call last):
File "/usr/bin/cset", line 47, in <module>
main()
File "/usr/lib/python3.11/site-packages/cpuset/main.py", line 234, in main
command.func(parser, options, args)
File "/usr/lib/python3.11/site-packages/cpuset/commands/set.py", line 186, in func
else: list_sets('root', options.recurse, options.usehex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/cpuset/commands/set.py", line 243, in list_sets
pl.append(set_details(s,' ', 78, usehex))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/cpuset/commands/set.py", line 487, in set_details
pathb = set.path[len(set.path//2):]
~~~~~~~~^^~
TypeError: unsupported operand type(s) for //: 'str' and 'int'
$ sudo cset -v
$ cset: Cpuset (cset) 1.6