firecat53 / keepmenu

Dmenu/Rofi frontend for Keepass databases
GNU General Public License v3.0
204 stars 32 forks source link

Gracefully handle KeyboardInterrupt #129

Closed vaygr closed 1 year ago

vaygr commented 2 years ago

This is mostly aesthetics, and doesn't cause any issues.

Process DmenuRunner-2:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 171, in main
    manager = client()
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 76, in client
    mgr.connect()
  File "/usr/lib/python3.10/multiprocessing/managers.py", line 531, in connect
    conn = Client(self._address, authkey=self._authkey)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 507, in Client
    c = SocketClient(address)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 635, in SocketClient
    s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/keepmenu", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 178, in main
    run(**args)
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 130, in run
    server.join()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 149, in join
Traceback (most recent call last):
    res = self._popen.wait(timeout)
  File "/usr/lib/python3.10/multiprocessing/popen_fork.py", line 43, in wait
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 171, in main
    manager = client()
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 76, in client
    mgr.connect()
  File "/usr/lib/python3.10/multiprocessing/managers.py", line 531, in connect
    conn = Client(self._address, authkey=self._authkey)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 507, in Client
    c = SocketClient(address)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 635, in SocketClient
    s.connect(address)
    return self.poll(os.WNOHANG if timeout == 0.0 else 0)
  File "/usr/lib/python3.10/multiprocessing/popen_fork.py", line 27, in poll
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/site-packages/keepmenu/keepmenu.py", line 295, in run
    self.server.start_flag.wait()
    pid, sts = os.waitpid(self.pid, flag)
  File "/usr/lib/python3.10/multiprocessing/synchronize.py", line 349, in wait
    self._cond.wait(timeout)
  File "/usr/lib/python3.10/multiprocessing/synchronize.py", line 261, in wait
    return self._wait_semaphore.acquire(True, timeout)
KeyboardInterrupt
KeyboardInterrupt
Process Server-1:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 171, in main
    manager = client()
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 76, in client
    mgr.connect()
  File "/usr/lib/python3.10/multiprocessing/managers.py", line 531, in connect
    conn = Client(self._address, authkey=self._authkey)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 507, in Client
    c = SocketClient(address)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 635, in SocketClient
    s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 97, in run
    self.kill_flag.wait()
  File "/usr/lib/python3.10/multiprocessing/synchronize.py", line 349, in wait
    self._cond.wait(timeout)
  File "/usr/lib/python3.10/multiprocessing/synchronize.py", line 261, in wait
    return self._wait_semaphore.acquire(True, timeout)
KeyboardInterrupt
vaygr commented 1 year ago

:tada: