Re: [Pyobjc-dev] Class OC_PythonObject: no such selector: _cfTypeID
Brought to you by:
ronaldoussoren
From: <jon...@mu...> - 2010-06-11 15:57:19
|
On 11 Jun 2010, at 04:45, Ronald Oussoren wrote: > > On 10 Jun, 2010, at 15:16, jon...@mu... wrote: > >> My ObjC app loads user generated PyObjC scripts using a Python NSObject subclass (see below) >> In general, errors in the Python scripts are generating application level exceptions. >> >> For instance, consider the following source file Boo.py. >> >> def funcBoo(): >> return result >> >> Dynamically loading Boo.py and calling funcBoo using the class below generates an ObjC NSException in the host app: >> Class OC_PythonObject: no such selector: _cfTypeID >> >> Assigning a value to the result variable resolves the problem. >> >> Is there a way of determining or reporting the underlying Python issue that is causing the NSException? > > Ensure that the following gets called somewhere: > > import objc; objc.setVerbose(1) > > After that PyObjC will log all exceptions when they get translated from Python to ObjC. > > That said, the exception that you are getting is not what I'd expect. I'll have to create a standalone application using your launcher to check what's going on here. > > Ronald Thanks. That helped me get to the bottom of the problem. The faulty Python was in fact generating a Python exception in the loader. My ObjC host app couldn't live with the tuple proxy class that the loader returned as a result of the Python exception. This was the source of the ObjC exception, not PyObjC itself. |