[Pythonmac-SIG] Environment variable issues running py2app application

Paul Wiseman poalman at gmail.com
Wed Apr 24 19:07:31 CEST 2013


Hey,

I've never seen this problem before but one user seems to be experiencing
this issue and I'm at a bit of a loss as to what the cause could be

One part of the app runs this: subprocess.Popen(['/usr/bin/env',
'system_profiler', 'SPUSBDataType', '-xml'])

I've never seen a problem running this, however in one users logs it's
returning: env: system_profiler: No such file or directory

So I thought that maybe their PATH variable doesn't include path to the
binary, I asked them to provide the output of '/usr/bin/env' and 'which
system_profiler'

'which system profiler' returned '/usr/sbin/system_profiler' and
'/usr/sbin' was in their PATH variable that returned from /usr/bin/env, so
I don't really get what's going on.

This also looks like it only happens if the user opens the .app directly,
but if they open the binary directly in the .app/Contents/MacOS/ folder, it
works and it can find these external binaries through subprocess.

I'm really not sure what might be causing this? and I've never experienced
it myself when testing, nor has it ever been reported before which makes me
inclined to believe it's some external setting / config on the users
machine which is causing this behaviour?

Thanks!

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20130424/d9428dab/attachment.html>


More information about the Pythonmac-SIG mailing list