8000 Weird interaction with Tkinter · Issue #10239 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Weird interaction with Tkinter #10239
Closed
Closed
@rdwmpls

Description

@rdwmpls

Bug report

Bug summary

Importing matplotlib before creating a Tk instance causes a crash.

Code for reproduction
Bad:

import Tkinter as tk
import matplotlib.pyplot as plt
root = tk.Tk()

Ok:

import Tkinter as tk
root = tk.Tk()
import matplotlib.pyplot as plt

Actual outcome

ron ~ $ python
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct  5 2017, 02:28:52) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter as tk
>>> import matplotlib.pyplot as plt
>>> root = tk.Tk()
2018-01-12 16:11:38.882 python[3561:147192] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fe13ec690e0
2018-01-12 16:11:38.883 python[3561:147192] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fe13ec690e0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff4533e1fb __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fff6bfbf942 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff453d5714 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff452b5b53 ___forwarding___ + 1443
	4   CoreFoundation                      0x00007fff452b5528 _CF_forwarding_prep_0 + 120
	5   libtk8.6.dylib                      0x000000010400146f TkpInit + 383
	6   libtk8.6.dylib                      0x0000000103f5a21e Initialize + 2622
	7   _tkinter.so                         0x0000000103d81be4 Tcl_AppInit + 84
	8   _tkinter.so                         0x0000000103d81448 Tkinter_Create + 1128
	9   libpython2.7.dylib                  0x000000010394f8f4 PyEval_EvalFrameEx + 22980
	10  libpython2.7.dylib                  0x0000000103949cd4 PyEval_EvalCodeEx + 2164
	11  libpython2.7.dylib                  0x00000001038cbbb3 function_call + 355
	12  libpython2.7.dylib                  0x00000001038a34d5 PyObject_Call + 101
	13  libpython2.7.dylib                  0x00000001038b2642 instancemethod_call + 162
	14  libpython2.7.dylib                  0x00000001038a34d5 PyObject_Call + 101
	15  libpython2.7.dylib    
5757
              0x0000000103953a2f PyEval_CallObjectWithKeywords + 159
	16  libpython2.7.dylib                  0x00000001038b05d4 PyInstance_New + 148
	17  libpython2.7.dylib                  0x00000001038a34d5 PyObject_Call + 101
	18  libpython2.7.dylib                  0x000000010394f578 PyEval_EvalFrameEx + 22088
	19  libpython2.7.dylib                  0x0000000103949cd4 PyEval_EvalCodeEx + 2164
	20  libpython2.7.dylib                  0x0000000103949452 PyEval_EvalCode + 34
	21  libpython2.7.dylib                  0x0000000103976ba1 PyRun_InteractiveOneFlags + 385
	22  libpython2.7.dylib                  0x000000010397659e PyRun_InteractiveLoopFlags + 110
	23  libpython2.7.dylib                  0x0000000103976450 PyRun_AnyFileExFlags + 64
	24  libpython2.7.dylib                  0x000000010398d572 Py_Main + 3506
	25  libdyld.dylib                       0x00007fff6cbac115 start + 1
	26  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Expected outcome

Too obvious to need to describe.

Matplotlib version

  • Operating system: macOS High Sierra (version 10.13.2)
  • Matplotlib version: 2.1.0
  • Matplotlib backend: MacOSX
  • Python version: Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 5 2017, 02:28:52)
  • Jupyter version (if applicable): N/A
  • Other libraries: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0