How to get additional py2app error information?

I am trying to pack 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 call py2app through

 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 warning or error, but when I try to start the recovery application, a pop-up window appears 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 from py2app to help diagnose this error?

+4
source share
2 answers

I believe this is a problem with the application and not with py2app .

If an application falls into an unhandled exception, it will exit as follows. What version of osx are you using? In 10.8, they stopped automatically redirecting stderr to the console, so it might be an idea to link stdout and stderr applications to a file to see if there is a stack trace.

Although if this is an error in the C ++ part, I assume that you will not see the stack trace, but the error may be in that part of the application.

If you really cannot find the problem, try removing large parts from the application until it starts, and then add a bit back until it starts, then split, etc. (e.g. binary search) to try and find the offending part.

+3
source

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

For example, for your project in ~/Projects/MyApp embedded in the ~/Projects/MyApp/dist folder, you can find the following from the command line: ~/Projects/MyApp/dist/MyApp.app/Contents/MacOS/MyApp

This will print to the console all the usual stderr messages so you can see what is wrong.

+2
source

Source: https://habr.com/ru/post/1435561/


All Articles