[Python.NET] bug in exception handling

Jonathan Mizrahi <[email protected]>
Newsgroups gmane.comp.python.dotnet
Message-ID <CAHBR9P4KDG+e64wHz+VizJCERoHUQWYmgumirKsmLAPrw8-R4Q@mail.gmail.com>
Hi,

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:

import clr
import sys
from PyQt4 import QtGui

try:
    clr.AddReference('foo') #This doesn't exist
except Exception as e:
    print e
app = QtGui.QApplication(sys.argv)
app.exec_()

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?

Thanks!

Jonathan Mizrahi

_________________________________________________
Python.NET mailing list - [email protected]
https://mail.python.org/mailman/listinfo/pythondotnet
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.