[Python-Dev] Interrupt thread.join() with Ctrl-C (original) (raw)

[Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

Jonathan Slenders jonathan at slenders.be
Tue Aug 8 05:54:28 EDT 2017


Hi all,

Is it possible that thread.join() cannot be interrupted on Windows, while it can be on Linux? Would this be a bug, or is it by design?

import threading, time def wait(): time.sleep(1000) t = threading.Thread(target=wait) t.start() t.join() # Press Control-C now. It stops on Linux, while it hangs on Windows.

Tested on Python 3.6.

Thanks, Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20170808/46a6c093/attachment.html>



More information about the Python-Dev mailing list