[Pythonmac-SIG] Re: sys.argv in applications (was: BundleBuilder help ?)

Steven Palm n9yty at n9yty.com
Tue Dec 9 09:06:54 EST 2003


On Dec 9, 2003, at 6:36 AM, Jack Jansen wrote:
On 9 Dec 2003, at 4:16, Kevin Ollivier wrote:
>> Looking at the bitpim source, my guess is that this line is causing  
>> the problem:
>>
>> resourcedirectory=os.path.abspath(os.path.join(os.path.dirname(sys.arg 
>> v[0]), 'resources'))
>> Using sys.argv like this can cause problems on OS X, which sends some  
>> extra args in when launched from the Finder.
>
> The finder adds a new sys.argv[1], the -psn business, but sys.argv[0]  
> should be fine. Here's the output from a simple application that dumps  
> sys.argv:
>
> Hello, sys.argv=  
> ['/Users/jack/tmp/build/hello.app/Contents/Resources/hello.py',  
> '-psn_0_2228225']
>
> The bundlebuilder bootstrap code tries to put decent values into  
> sys.argv, so if it fails to do this in certain circumstances please  
> file a bug report...

  Okay, well, in this case, Kevin's suggestions made it work, it was not  
working previously. I guess this should precipitate a bug report, then?  
Is that filed at python.org, or elsewhere?

-. ----. -.-- - -.--
Steve Palm - n9yty at n9yty.com
-. ----. -.-- - -.--





More information about the Pythonmac-SIG mailing list