Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Annoying message when opening windows from Python on OS X 10.8

Whenever I run a Python script that opens any kind of window on OS X 10.8, whether it's a GLUT window or a QT one or anything else, I get a message that looks like this:

2013-09-11 14:36:53.321 Python[3027:f07] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/0x/25_70mj17tb1ypm1c_js8jd40000gq/T/org.python.python.savedState 

I use python2.7 installed via MacPorts.

This is a minor annoyance, but I'm curious to know what the message means, and whether there's anything I can do to prevent it. Is it due to a misconfiguration of my system, or does everyone get this?

like image 579
N. Virgo Avatar asked Sep 11 '13 06:09

N. Virgo


1 Answers

The correct command to run is:

defaults write org.python.python ApplePersistenceIgnoreState NO 

This message appears due to the "application resume" feature in newer versions of OS X. Clearly, this isn't a useful feature for most Python programs (in my case, plotting data with matplotlib), so we can just turn it off with the above command.

For more information on what defaults write is actually doing, check out the man page.

like image 56
perimosocordiae Avatar answered Sep 28 '22 00:09

perimosocordiae