Signal handler setup appears to hang on Windows #2610
Labels
Bug
Things to squish; generally used for issues
Long-term Planning
Things that need to happen at some point in the future, but need to NOT happen soon.
Windows
Description
When run on Windows, Sopel appears to hang after
asyncio
emits the log line, "Using proactor: IocpProactor".Under the hood, what actually happens here is that the event loop starts, but trying to set up a signal handler (code excerpt below) raises
NotImplementedError
on Windows and execution stalls.sopel/sopel/irc/backends.py
Lines 478 to 482 in ab32aca
The error and traceback is logged to
configname.exceptions.log
.Reproduction steps
Expected behavior
Sopel's signal handling needs a rework to behave at least somewhat correctly cross-platform, even if the Windows code path can't fully support all features offered on Unix-like platforms.
There is probably a way to make everything work, with a bit of "AI" (read:
if
/else
checks). I just haven't looked into it because this whole thing ain't getting worked on before 8.1.Relevant logs
Notes
If I comment out the
add_signal_handler()
calls shown above, Sopel runs just fine (modulo #1382 issues with stopping it; one must press Ctrl-C twice to actually stop the bot, else it will reconnect after 20 seconds).Implementation-wise, the stdlib
signal
library could help with fixing this.Line numbers in
sopel/irc/backends.py
might be slightly off in the traceback I attached because I was modifying my local copy to debug things and did not revert those edits before starting to write this issue.Sopel version
3261d9c
Installation method
pip install
Python version
3.12.3
Operating system
Windows 11
IRCd
No response
Relevant plugins
No response
The text was updated successfully, but these errors were encountered: