Here is a minimal example to demonstrate the problem.
What tools can I use to debug this?
sudshang.py:
import sys
import suds
import suds.client
#import PyQt5.Qt # uncomment this to cause hang
import threading
from functools import partial
WebServiceTimeout = 30
url = "
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"
def get_with_cb(callback):
print "getting %s" % url
# hang happens on the following line
client = suds.client.Client(url, timeout=WebServiceTimeout)
print "client is: ", client
callback("get_with_cb")
def callback(arg):
print "done", arg
sys.stdout.flush()
class Async(object):
def __init__(self, callback):
self._callback = callback
def start(self):
p = partial(get_with_cb, self._callback)
t = threading.Thread(target=p)
t.start()
sys.stdout.flush()
print "thread started"
self.t = t
def join(self):
self.t.join()
def main():
# call it in the main thread to prove that it works
get_with_cb(callback)
# call it in another thread
w = Async(callback)
w.start()
print "waiting"
w.join()
print "finished waiting"
if __name__ == "__main__":
main()
-----
Freeze using:
pyinstaller.py -y sudshang[.py|.spec]