Skip to content

macOS: pitop still crashes on initialization on macOS when CPU util == 0 #1

Description

@ymode

when pitop is initialized on macOS and CPU utilization is 0 the current issue arises:

line 143, in <module>
    process_items = urwid.SimpleFocusListWalker(get_process_list())
                                                ^^^^^^^^^^^^^^^^^^
  File "~/pitop/pitop/./pitop.py", line 131, in get_process_list
    process_list.append(ProcessRow(proc_info))
                        ^^^^^^^^^^^^^^^^^^^^^
  File "~/pitop/pitop/./pitop.py", line 16, in __init__
    cpu = f"{proc_info['cpu_percent']:.1f}"
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported format string passed to NoneType.__format__

this issue is not present on linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingmacOSissue is present on macOS

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions