Title: ApplePersistenceIgnoreState warning on macOS
Type: behavior Stage:
Components: macOS Versions: Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cbrnr, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2018-02-22 10:55 by cbrnr, last changed 2018-02-23 08:23 by ronaldoussoren.

Messages (3)
msg312550 - (view) Author: (cbrnr) Date: 2018-02-22 10:55
There seems to be a problem with using certain Python packages and the application resume feature of recent macOS versions. Specifically, whenever I "import matplotlib.plyplot" or run the magic command "%matplotlib" in IPython, I get the following warning message:

2018-02-22 10:35:38.287 Python[4145:281298] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)

There's an issue in the matplotlib repo (, but I don't think this problem can be fixed by matplotlib. Instead, according to this SO post (, the following command fixes the behavior:

defaults write org.python.python ApplePersistenceIgnoreState NO

Since this problem also comes up with Homebrew, I created an issue (, but the maintainers indicated that (1) this might be a Python issue and should be addressed upstream, and (2) the solution above is not a real fix and the correct behavior should be implemented programmatically by Python itself.
msg312590 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-02-22 19:32
I don't know much about this but it seems to be due to the application Resume feature added in OS X 10.7 and has to do with the persistence of application windows.  Python itself does not create any such windows; they are created by the GUI toolkits used in Python applications, like Tk (used by the standard library tkinter) or other third-party modules that interface to other toolkits (PyQT, PyObjC, etc). I took a quick look and didn't see any application bundle keys that could be added to the Info.plist to disable persistence globally in a Python framework build and, even if there were one, I'm not sure that is desirable.  Perhaps the best way is for each tool kit to do it.  Ronald, anyone else: have any suggestions?
msg312621 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2018-02-23 08:23
The ApplePersistenceIgnoreState setting (either in user defaults or an info.plist file) is IMHO not the right solution, as this is a setting intended to be used for testing (see <>)

I don't have time to research this fully at this time, but expect that this is something that should be fixed in GUI libraries (or possibly matplotlib).
Date User Action Args
2018-02-23 08:23:45ronaldoussorensetmessages: + msg312621
2018-02-22 19:32:40ned.deilysetmessages: + msg312590
2018-02-22 10:55:16cbrnrcreate