On 14/06/14 09:46, Glenn Ramsey wrote:
On 14/06/14 09:40, Glenn Ramsey wrote:
On 13/06/14 20:05, Martin Zibricky wrote:
On Friday 13 of June 2014 12:23:36 Glenn Ramsey wrote:
It works properly on OSX and when run from the command line or from
Eclipse/PyDev in Windows.
Does anyone know what the problem might be? How can I debug this in the
packaged app?
You haven't mentioned pyinstaller version.
Oops, sorry. I'm using the latest develop branch.
Also just to be clear about what is hanging. The main thread keeps running, it's
the thread that is calling suds that hangs.
Glenn
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]
I have narrowed this down further. It also occurs on OSX and not Windows as I
had first thought.
There is a new file: loader/rthooks/pyi_rth_qt5.py which causes all of the Qt
modules to get included in the package if one module is included. It also merges
the names from each module into the PyQt5.Qt namespace. So if I import only
PyQt.QtCore then all of the Qt modules get included in the package.
So one of the Qt modules that I am not using is interfering somehow with suds.
I'll keep trying to track it down.
I have worked around my problem by disabling pyi_rth_qt5.py in rthooks.dat. So
that only the Qt modules that I am using get included.
There appears also to be a related bug - when any Qt module is imported you have
to also import PyQt5.Qt or there is an error about pyi_rth_qt5.py not being able
to find the Qt module when running the packaged script.
Glenn
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.