Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get more information about a py2app error?

Tags:

py2app

I am trying to package up a mixed Python/C++ application using py2app. My setup.py is

from setuptools import setup
setup(app=['voxpopuli.py'],data_files=[],options=
  {'py2app'{'argv_emulation':True}},setup_requires=['py2app'])

and I invoke py2app via

python setup.py py2app --no-strip --iconfile /Users/irving/otherlab/other/bin/OLicon.icns --resources /opt/local/lib/Resources/qt_menu.nib

This completes without warnings or errors, but when I try to run the resuling app a window pops up that simply says "voxpopuli Error". It has an "Open Console" button, but the only console messages are

9/21/12 11:43:14.691 AM voxpopuli[52765]: voxpopuli Error
9/21/12 11:43:15.926 AM com.apple.launchd.peruser.501[158]: ([0x0-0x177d77c].org.pythonmac.unspecified.voxpopuli[52765]) Exited with code: 255

Are there standard ways to get more information out of py2app to help diagnosing this error?

like image 857
Geoffrey Irving Avatar asked Sep 21 '12 18:09

Geoffrey Irving


2 Answers

I believe this is a problem with the app rather than the py2app.

If the app hits an unhandled exception it will exit out like this. Which version of osx are you using? In 10.8 they stopped automatically forwarding stderr to the console, so might be an idea to pipe the applications stdout and stderr to a file to see if you have a stack trace.

Although if it's an error in the C++ part I'm guessing you wouldn't see a stack trace, but the error could be in that part of the application.

If you really can't find the issue, try stripping large parts out the app until it runs then add bits back in until it doesn't run, then strip etc. (like a binary search) to try and find the offending part.

like image 56
GP89 Avatar answered Oct 08 '22 07:10

GP89


With the package built you can still run the 'application' from the command line.

For example for your project in ~/Projects/MyApp built into folder ~/Projects/MyApp/dist you should find you can run the following from commandline: ~/Projects/MyApp/dist/MyApp.app/Contents/MacOS/MyApp

This will output all the normal stderr messages to the console so you can see what is going wrong.

like image 33
mfitzp Avatar answered Oct 08 '22 07:10

mfitzp