[Pythonmac-SIG] ext build problem

Keith Jackson krjackson at lbl.gov
Wed Oct 29 15:13:16 EST 2003


Jack,
thanks for the answer. I'll look at the right _NSGetEnviron() call. 
This will work fine for my code.

Is there a problem with using the "--bundle_loader" option to the 
linker to solve this problem when I don't have an easy way to modify 
the C code? If I understand correctly, I could modify the setup.py to 
add the bundle loader option, and then the bundle would be able to link 
to the _environ in the python inerpreter.

thanks again for you help,
--keith


On Wednesday, October 29, 2003, at 04:23 AM, Jack Jansen wrote:

>
> On 29 Oct 2003, at 0:35, Keith Jackson wrote:
>
>> All,
>> Once again I've run into the "_environ" problem while trying to build 
>> 4Suite. I'm using python2.3.2 built as a framework build. As part of 
>> trying to debug this, I've written a very simple test that shows the 
>> same behavior for me. I'd appreciate it if someone else could try 
>> this and see if they see the same behavior. Also, if I'm doing 
>> something dumb please let me know. ;)
>
> It's not you who's doing something dumb, it's Apple:-)
>
> _environ is defined in crt0, which means you don't have access to it 
> in shared libraries or bundles. The workaround is to call 
> _NSGetEnviron() to get at the environment pointer, see 
> Modules/posixmodule.c for a way to do this in one place in your code 
> that will make _environ available to all the rest of your shared 
> library (or bundle).
> --
> Jack Jansen        <Jack.Jansen at cwi.nl>        http://www.cwi.nl/~jack
> If I can't dance I don't want to be part of your revolution -- Emma 
> Goldman
>




More information about the Pythonmac-SIG mailing list