Hi Tangoers,
We try to migrate from PyTango 8.1.6 to 9.2 for our Windows clients.
As we did’nt manage yet to compile PyTango 9.2.3, I use a msi installer for PyTango9.2.0.
We use Python 2.7 32b.
With PyTango9.2.0 within a Qt Application,
if I subscribe to an attribute using pyds.subscribe_event
then Python crashed when I call :
app = QtGui.QApplication(sys.argv)
app.quit()
The same code works with PyTango 8.1.3.
An example is attached.
If somebody could tell me if it works on Windows with PyTango 9.2.3, it would motive us to compile !
launch:
DeclareDS
TestDevice
Client
Push OK
If you have a workaround …
Cheers,
Christophe
sample code for the client :
class EventManager():
def __init__(self,deviceAdr, attrAdr,fct,app):
#Subscribe to the counter
self.pyds = PyTango.DeviceProxy(deviceAdr)
self.id_event = self.pyds.subscribe_event(attrAdr, PyTango.EventType.CHANGE_EVENT, self.ReceiveTangoEvent, stateless = True)
self.app = app
self.wd = QtGui.QLabel("TEST")
self.wd.show()
#The QUIT button close the application
self.wdButton = QtGui.QPushButton("QUIT")
self.wdButton.clicked.connect(self.stop)
self.wdButton.show()
#Create a Signal to display the Tango Value
QtCore.QObject.connect(Qt.qApp, QtCore.SIGNAL("updateData(PyQt_PyObject)"),self.UpdateGui)
def ReceiveTangoEvent(self,event):
print str(event.attr_value.value)
Qt.qApp.emit(QtCore.SIGNAL("updateData(PyQt_PyObject)"),str(event.attr_value.value))
def UpdateGui(self,data):
self.wd.setText(data)
#Called by the QUIT button (OK in PyTango 8.1.6, CRASH in PyTango 9.2.0)
def stop(self):
QtCore.QObject.disconnect(Qt.qApp, QtCore.SIGNAL("updateData(PyQt_PyObject)"),self.UpdateGui)
self.pyds.unsubscribe_event(self.id_event)
self.app.quit()
if __name__ == "__main__": # pragma: no cover
app = QtGui.QApplication(sys.argv)
#The server push a counter
ev1 = EventManager("test/TestDevice/TestDevice","trignumber",test1,app)
sys.exit(app.exec_())
you could check to see if the issue is solved in PyTango 9.2.3 using the pre-compiled binaries for Windows which are part of the continuous integration system on AppVeyor. Take a look at the slides 9 to 19 in this presentation:
Although I don’t have a Windows version of PyTango 9.2.3, I’ve tested your code (the 2nd client version) on the linux version of PyTango 9.2.2 and it works as expected. Perhaps you could download the Windows version 9.2.2 and try it.
I cannot reproduce your problem with 9.2.2 on linux neither.
Could you send the error message?
I recommend you try with 9.2.2.
I don’t see anything in the PyTango changelog that indicates your problem might be solved but since PyTango is statically linked with the tango C++ library on Windows, if you update PyTango, automatically you use the new Tango C++. So even if the problem is coming from the C++ layer, updating should make the problem disappear.
Hi Tiago and Geoff,
There is no error message, just a “python.exe stopped working”.
Do you know if there is an installer (msi, exe) for PyTango 9.2.2 on Windows because we didn’t manage to recompile.
Christophe
Thanks Sébastien, the msi is working fine.
I still get a crash but with an error message :
Assertion failed: Successful WSASTARTUP not yet performed (......\src\signaler.cpp:377)
Hi, sorry for the late response. The last two messages are on the second page an I missed them.
Maybe a Tango C++ expert can confirm but my guess is that the error is in 0MQ itself.
If this is true the only fix I see is to recompile the whole chain with a version of ZMQ library which fixes the problem.
Hi,
Sorry, too busy, or on holidays :-), to test until now …
So I have installed PyTango 9.2.3 and pyzmq 17.1.2 (so theorically zmq 4.2.5) and I still have the same problem with message :
Assertion failed: Successful WSASTARTUP not yet performed (......\src\signaler.cpp:377).
For now, the only solution I have is to keep PyTango 8.2.6.
As my test on Windows, any pytango application(pytango-9.2.4 + zmq-4.2.4) using tango event will report this assertion failure on exit:
assertion failed:Successfully WSASTARTUP not yet performed[10093](..\..\..\..\src\ip.cpp:413)
but the same C++ application linked with tango dynamic library will not report this failure on exit. so this failure may relate to zmq static library on windows.
when i have time i will test c++ tango application linked with tango static library.