[Python.NET] bug in exception handling
mizrahi.jonathan at gmail.com
Sun Aug 16 03:53:01 CEST 2015
I may have found a bug in how the clr package converts .net exceptions to
Python exceptions, at least as it relates to PyQt. If I try and add a
library which does not exist, and then try and print the exception, PyQt is
subsequently unable to initialize OLE. This means that PyQt applications
cannot use copy/paste and drag-and-drop.
Here is a minimal example:
from PyQt4 import QtGui
clr.AddReference('foo') #This doesn't exist
except Exception as e:
app = QtGui.QApplication(sys.argv)
This results in the Qt error:
Qt: Could not initialize OLE (error 80010106)
The program runs, but copy/paste and drag-and-drop fails. If I do not try
and print the exception (replace the except block with 'pass'), the program
runs without any problems. Also, if the library exists I have no problems.
Is this something anyone has seen before?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PythonDotNet