I asked an LLM agent to summarize the issue, including providing an example to reproduce.
System: macOS, Cocoa.
import atexit
import webview
def proof():
with open("/tmp/atexit_proof.txt", "w") as f:
f.write("atexit ran")
atexit.register(proof)
window = webview.create_window("Test", html="<h1>Test</h1>")
webview.start()
Close via X → /tmp/atexit_proof.txt exists. Close via Ctrl+C → it doesn't exist.
Using Cocao, Ctrl+C terminates the app, but it terminates via NSApp().terminate_() at the Cocoa level, which never returns to Python. Compare this to the QT backend which calls _app.quit() — that exits the Qt event loop and returns control to Python, allowing normal shutdown.
I asked an LLM agent to summarize the issue, including providing an example to reproduce.
System: macOS, Cocoa.
Close via X →
/tmp/atexit_proof.txtexists. Close via Ctrl+C → it doesn't exist.Using Cocao, Ctrl+C terminates the app, but it terminates via
NSApp().terminate_()at the Cocoa level, which never returns to Python. Compare this to the QT backend which calls_app.quit()— that exits the Qt event loop and returns control to Python, allowing normal shutdown.