mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
0de3c3b572
Currently when process is started through asyncio Runner and it is termited e.g. with SIGINT(ctrl+c) a traceback is printed instead of gracefully exit. Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x7fe980970900> Traceback (most recent call last): File "/usr/lib64/python3.12/asyncio/base_subprocess.py", line 129, in __del__ self.close() File "/usr/lib64/python3.12/asyncio/base_subprocess.py", line 107, in close proto.pipe.close() File "/usr/lib64/python3.12/asyncio/unix_events.py", line 568, in close self._close(None) File "/usr/lib64/python3.12/asyncio/unix_events.py", line 592, in _close self._loop.call_soon(self._call_connection_lost, exc) File "/usr/lib64/python3.12/asyncio/base_events.py", line 793, in call_soon self._check_closed() File "/usr/lib64/python3.12/asyncio/base_events.py", line 540, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed This is caused because asyncio Runner context in asyncio.run is closing the event loop and if exception is unhandled in coroutine(run_command) the transport is not closed before the even loop is closed and we get RuntimeError: Event loop is closed in the transport __del__ function because it's trying to use the closed even loop. Let's catch asyncio.CancelledError in case the process we are trying to read from is terminated, print message, let the asyncio finish and exit gracefully. Closes https://github.com/espressif/esp-idf/issues/13418 Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com> |
||
---|---|---|
.. | ||
ble | ||
catch | ||
ci | ||
cmake | ||
docker | ||
esp_app_trace | ||
esp_prov | ||
gen_soc_caps_kconfig | ||
idf_py_actions | ||
kconfig_new | ||
ldgen | ||
mass_mfg | ||
mocks | ||
requirements | ||
templates/sample_component | ||
test_apps | ||
test_build_system | ||
test_idf_py | ||
test_idf_tools | ||
test_mkdfu | ||
test_mkuf2 | ||
unit-test-app | ||
check_python_dependencies.py | ||
check_term.py | ||
detect_python.fish | ||
detect_python.sh | ||
eclipse-code-style.xml | ||
format-minimal.sh | ||
format.sh | ||
gdb_panic_server.py | ||
gen_esp_err_to_name.py | ||
generate_debug_prefix_map.py | ||
idf_monitor.py | ||
idf_size.py | ||
idf_tools.py | ||
idf.py | ||
install_util.py | ||
mkdfu.py | ||
mkuf2.py | ||
python_version_checker.py | ||
requirements_schema.json | ||
requirements.json | ||
set-submodules-to-github.sh | ||
split_paths_by_spaces.py | ||
tools_schema.json | ||
tools.json |