-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Description
The Python bindings use threads in 2 places in the WebSocket
class (in py/selenium/webdriver/remote /websocket_connection.py
), for starting the WebSocket and for executing callbacks.
The threads are not started as "daemon threads".
From the Python docs:
"A thread can be flagged as a “daemon thread”. The significance of this flag is that the entire Python program exits when only daemon threads are left."
The consequence of this is that a program can't be terminated if the WebSocket connection has not been closed and all callbacks are not complete. This might be annoying if you just want to abruptly exit and don't care about connections that are still open.
To change this behavior, we can add the daemon=True
argument in the 2 places we instantiate the Thread
class.
Have you considered any alternatives or workarounds?
No response