[Pythonmac-SIG] Knock me over with a spoon! [was: getting at the XML in nib files]

Steven Majewski sdm7g@Virginia.EDU
Fri, 18 Jan 2002 13:14:39 -0500 (EST)


On Fri, 18 Jan 2002, Jack Jansen wrote:

>
> On Friday, January 18, 2002, at 03:52 , Steven Majewski wrote:
>
> Could you give some (as detailed as possible) instructions as to how to
> get the ObjC module and how you've built it? Then I'll try and find the
> time to give it a spin. Or, preferrably, someone else will beat me to
> it:-)


Grab and unpack:
	<http://prdownloads.sourceforge.net/pyobjc/pyobjc-0.6.tar.gz>

and in that pyobjc directory do:
	python setup.py build

or, if you do:
	python setup.py install
it'll get installed in  site-packages/

If you have several versions of python installed, if you do:

	python2.1 setup.py install

it'll get built for that version and install in (most likely):
	/usr/local/lib/python2.1/site-packages
(likewise for python2.2)


On my latest attempt, it builds, imports and functions properly
(or at least, nearly as well as it ever did!) with 2.1 .

For 2.2, it builds OK but gives that error on import.


> The error, incidentally, is NSLinkModule() failing, down in
> dynload_next.c. You could try setting some of the DYLD_xxxxx environment
> variables or running under gdb to see what the problem is. Maybe 2-level
> namespaces, maybe an external from Python you use that was there in 2.1
> but missing in 2.2 (but you should have gotten a warning on compilation,
> because the prototype will also have gone).


running in gdb, I find:

in _PyImport_LoadDynamicModule,
    in _PyImport_GetDynLoadFunc,
after:
	rc = NSCreateObjectFileImageFromFile(pathname, &image);

rc == NSObjectImageFileSuccess

but when it hits NSLinkModule, it seems to be returning 0x0:

150                     if (errString == NULL) {
151                             newModule = NSLinkModule(image, pathname,
152                                     NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
153                             if (!newModule)
154                                     errString = "Failure linking new module";
155                     }


... maybe those options don't match the type of bundle ?

I'll give your suggestions a try.


-- Steve