libc++abi.dylib: terminating with uncaught exception of type NSException
When I try to run iMad.py or radcal.py on a Mac (specifically, a mid 2015 Retina MacBook Pro running OS X 10.11.6 "El Capitan"), a Finder window opens, I select a directory that contains two 8-bit three-channel (RGB) geotiffs, and I get the following error.
2016-09-26 13:35:40.466 python[33582:5516586] An uncaught exception was raised
2016-09-26 13:35:40.466 python[33582:5516586] File types array cannot be empty
2016-09-26 13:35:40.466 python[33582:5516586] (
0 CoreFoundation 0x00007fff8ab1a4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff918cbf7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff8ab814bd +[NSException raise:format:] + 205
3 AppKit 0x00007fff93f81408 -[NSSavePanel setAllowedFileTypes:] + 294
4 libtk8.5.dylib 0x000000010a6f69e5 Tk_GetOpenFileObjCmd + 1400
5 libtcl8.5.dylib 0x000000010a55883c TclEvalObjvInternal + 1160
6 libtcl8.5.dylib 0x000000010a558ab7 Tcl_EvalObjv + 57
7 _tkinter.so 0x000000010a53b069 Tkapp_Call + 601
8 libpython2.7.dylib 0x00000001000b59c5 PyEval_EvalFrameEx + 32645
9 libpython2.7.dylib 0x00000001000ad732 PyEval_EvalCodeEx + 1538
10 libpython2.7.dylib 0x00000001000b9eb5 fast_function + 117
11 libpython2.7.dylib 0x00000001000b4da4 PyEval_EvalFrameEx + 29540
12 libpython2.7.dylib 0x00000001000ad732 PyEval_EvalCodeEx + 1538
13 libpython2.7.dylib 0x00000001000b9eb5 fast_function + 117
14 libpython2.7.dylib 0x00000001000b4da4 PyEval_EvalFrameEx + 29540
15 libpython2.7.dylib 0x00000001000b9f52 fast_function + 274
16 libpython2.7.dylib 0x00000001000b4da4 PyEval_EvalFrameEx + 29540
17 libpython2.7.dylib 0x00000001000ad732 PyEval_EvalCodeEx + 1538
18 libpython2.7.dylib 0x00000001000ad126 PyEval_EvalCode + 54
19 libpython2.7.dylib 0x00000001000dbf04 PyRun_FileExFlags + 164
20 libpython2.7.dylib 0x00000001000dba81 PyRun_SimpleFileExFlags + 769
21 libpython2.7.dylib 0x00000001000f15c8 Py_Main + 3096
22 python 0x0000000100001f24 start + 52
)
2016-09-26 13:35:40.467 python[33582:5516586] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'File types array cannot be empty'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8ab1a4f2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff918cbf7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff8ab814bd +[NSException raise:format:] + 205
3 AppKit 0x00007fff93f81408 -[NSSavePanel setAllowedFileTypes:] + 294
4 libtk8.5.dylib 0x000000010a6f69e5 Tk_GetOpenFileObjCmd + 1400
5 libtcl8.5.dylib 0x000000010a55883c TclEvalObjvInternal + 1160
6 libtcl8.5.dylib 0x000000010a558ab7 Tcl_EvalObjv + 57
7 _tkinter.so 0x000000010a53b069 Tkapp_Call + 601
8 libpython2.7.dylib 0x00000001000b59c5 PyEval_EvalFrameEx + 32645
9 libpython2.7.dylib 0x00000001000ad732 PyEval_EvalCodeEx + 1538
10 libpython2.7.dylib 0x00000001000b9eb5 fast_function + 117
11 libpython2.7.dylib 0x00000001000b4da4 PyEval_EvalFrameEx + 29540
12 libpython2.7.dylib 0x00000001000ad732 PyEval_EvalCodeEx + 1538
13 libpython2.7.dylib 0x00000001000b9eb5 fast_function + 117
14 libpython2.7.dylib 0x00000001000b4da4 PyEval_EvalFrameEx + 29540
15 libpython2.7.dylib 0x00000001000b9f52 fast_function + 274
16 libpython2.7.dylib 0x00000001000b4da4 PyEval_EvalFrameEx + 29540
17 libpython2.7.dylib 0x00000001000ad732 PyEval_EvalCodeEx + 1538
18 libpython2.7.dylib 0x00000001000ad126 PyEval_EvalCode + 54
19 libpython2.7.dylib 0x00000001000dbf04 PyRun_FileExFlags + 164
20 libpython2.7.dylib 0x00000001000dba81 PyRun_SimpleFileExFlags + 769
21 libpython2.7.dylib 0x00000001000f15c8 Py_Main + 3096
22 python 0x0000000100001f24 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
Any suggestions?
I have solved the immediate problem described above by changing line 391 of auxil.py from filename = tkFileDialog.Open(filetypes=filetypes,title=title).show() to filename = tkFileDialog.Open(title=title).show() (removing the filetypes argument). I take it that this change is not ideal because it moves the ability to filter by filetype.
Yes, not so ideal although also not so important. I can't see the error on 64bit Linux, and I know that there was no problem on my original WIndows 7 development machine, so maybe a bug in OS X/Tkinter?
That seems right. For the moment I am just going to live with this solution; I do not know when or if I will get the chance to develop something more general.