---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
Cell In[17], line 1
----> 1 print(shell_ret('du -sh', host='hack'))
Cell In[13], line 8, in shell_ret(cmd, capture_output, text, ret, **kwargs)
4 "Run shell command locally or over ssh (use host for alias, or ip/user/keyfile)"
5 host, ip, user, keyfile = kwargs.pop('host', None), kwargs.pop('ip', None), kwargs.pop('user', None), kwargs.pop('keyfile', None)
6 if host: cmd = f"echo '{cmd}' | ssh -A {host} 'bash -ls'"
7 elif ip: cmd = f"echo '{cmd}' | ssh {f'-i {keyfile} ' if keyfile else ''}-A {user}@{ip} 'bash -ls'"
----> 8 o = subprocess.run(cmd, shell=True, text=text, capture_output=capture_output, **kwargs)
9 return (o.stdout or o.stderr) if ret else o
File ~/.local/share/uv/python/cpython-3.13.15-macos-aarch64-none/lib/python3.13/subprocess.py:556, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
554 with Popen(*popenargs, **kwargs) as process:
555 try:
--> 556 stdout, stderr = process.communicate(input, timeout=timeout)
557 except TimeoutExpired as exc:
558 process.kill()
File ~/.local/share/uv/python/cpython-3.13.15-macos-aarch64-none/lib/python3.13/subprocess.py:1222, in Popen.communicate(self, input, timeout)
1219 endtime = None
1221 try:
-> 1222 stdout, stderr = self._communicate(input, endtime, timeout)
1223 except KeyboardInterrupt:
1224 # https://bugs.python.org/issue25942
1225 # See the detailed comment in .wait().
1226 if timeout is not None:
File ~/.local/share/uv/python/cpython-3.13.15-macos-aarch64-none/lib/python3.13/subprocess.py:2154, in Popen._communicate(self, input, endtime, orig_timeout)
2147 self._check_timeout(endtime, orig_timeout,
2148 stdout, stderr,
2149 skip_check_and_raise=True)
2150 raise RuntimeError( # Impossible :)
2151 '_check_timeout(..., skip_check_and_raise=True) '
2152 'failed to raise TimeoutExpired.')
-> 2154 ready = selector.select(timeout)
2155 self._check_timeout(endtime, orig_timeout, stdout, stderr)
2157 # XXX Rewrite these to use non-blocking I/O on the file
2158 # objects; they are no longer using C stdio!
File ~/.local/share/uv/python/cpython-3.13.15-macos-aarch64-none/lib/python3.13/selectors.py:398, in _PollLikeSelector.select(self, timeout)
396 ready = []
397 try:
--> 398 fd_event_list = self._selector.poll(timeout)
399 except InterruptedError:
400 return ready
File ~/aai-ws/kernmini/kernmini/kernel.py:821, in MiniKernel.handle_sigint(self, signum, frame)
819 if parent.cancel_async_execution(wake=True): return
820 if not parent.sync_executing.is_set(): return
--> 821 raise KeyboardInterrupt
KeyboardInterrupt: