It turns out that the built-in display (and perhaps even the generation of the image in the first place) failed because matplotlib was unable to load the Vera.ttf font Vera.ttf . He tried to download this file from the wrong file system location, which was not available for a process that was running in the OS X sandbox.
10/29/13 11:59:02.000 PM kernel[0]: Sandbox: python(24173) deny file-read-data $HOME/Library/Developer/Xcode/DerivedData/IPython_Notebook-adcshxaaibpeztbztvthgauvufsx/Build/Products/Debug/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf
The process ran from this location:
$HOME/Library/Developer/Xcode/DerivedData/IPython_Notebook-adcshxaaibpeztbztvthgauvufsx/Build/Products/Release/IPython Notebook.app
("Debugging" and "Release")
After I damaged the Debug location and restarted the application, the sandbox message disappeared and the built-in graph started working. When I copied the application package to another location and launched it from there, it again failed. A stack trace in the sandbox violation report indicates that FreeType is trying to download the font from the old location:
0 libsystem_kernel.dylib 0x00007fff9054f5da __open + 10 1 libfreetype.dylib 0x000000010b789214 FT_Stream_New + 260 2 libfreetype.dylib 0x000000010b789e00 FT_Open_Face + 144 3 libfreetype.dylib 0x000000010b789d5e FT_New_Face + 46 4 ft2font.so 0x000000010b7259f0 FT2Font::FT2Font(Py::PythonClassInstance*, Py::Tuple&, Py::Dict&) + 698 5 ft2font.so 0x000000010b735fa6 Py::PythonClass<FT2Font>::extension_object_init(_object*, _object*, _object*) + 116
Some research has shown that matplotlib supports the fontList.cache file, which ends in the container directory for the application sandbox. After moving the application package, the paths in this cache file are invalid / inaccessible. I added code to my application to delete this cache file at startup.
So this is not an IPython problem, but I thought I would post it if it helps someone who will also introduce the laptop into the OS X app sandbox in the future.
source share