The doc for QThread.terminate() says its use "is discouraged".<br><br>I have a thread that calls urllib2 to read an http page. I am having a problem where this thread gets hung somewhere in the urllib2 -- remains to be determined whether in urllib2.urlopen() or in a read() on the resulting object.<br>
<br>Anyway, I am thinking of implementing a Kill button so the main thread can stop and recreate the worker threadin case of such a hang. But am puzzled on several points:<br><br>1. Would .terminate of a QThread that is hung within a python lib, actually achieve anything, i.e. break out of the python hang?<br>
<br>2. If it did exit the python lib code, would it be likely to leave python itself (or PyQt or Sip) in some bad indeterminate state that would cause further problems, e.g. when the thread is recreated and calls back into urllib2?<br>
<br>3. What about QThread.exit() -- I can't figure out if it is meant for calling from within the thread's code, or from outside it? Would it be of use in a "kill" situation?<br><br>Any input would be helpful, thank you for your time.<br>