-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OOB Failure - Example Does not Run on Windows #7
Comments
Long Term Remedy For reference, I don't know what the correct signal for CTRL-C is, but CTRL-BREAK works by handling SIGBREAK on Windows.
|
Hi @thygrrr have you managed to solve this issue? Could you provided us with some explanation here? |
To anyone looking for a quick fix, just comment out the lines that refer to SIGHUP, seems to not cause any issues, other than related to keyboard interrupts. |
I would like to report a pair of out-of-the-box issues with example.py / the "SDK".
In a Python 3.10.2 venv on Windows 11 Pro x64, trying to run the example will yield the following output:
Issue diagnosis
The main issue is that it appears as if the
signal
library is not used correctly in a portable way. For platform portability, only signals fromdir(signal)
are valid, or at runtime,signal.valid_signals()
.On Windows 11 pro x64, this notably excludes SIGHUP, which is only available on Unix and on most BSD flavors (including OSX).
The other issue show that some failure state cannot be handled, probably because it uses the dangerous JavaScript pattern of equating nonexistent properties to undefined on access. I think
hasattr()
is a better way to implement this logic here, rather thanclient_id = self.client_id
followed by a branch onif(client_id):
. A general recommendation would be to never allow the application to represent a state where this attribute doesn't exist on the class.Experimental remedy
Removing the offending use of SIGHUP from the library code, the example appears to run as expected. However, it doesn't listen to CTRL-C or other keyboard interrupts (not the best behaviour, I had plane for that terminal session :D), and it will likely not receive the expected signal if I close the terminal now. (Windows Terminal, for that matter)
The text was updated successfully, but these errors were encountered: