Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1124 which is that the use of
%matplotlib osx
crashesipykernel
and downstream libraries whereasipython
is fine.The fix is to specify the
argtypes
of eachobjc_msgSend
call just before the call. This is consistent with howipython
successfully handles it. I have tested this manually usingspyder
andjupyter console
,qtconsole
,lab
andnbclassic
: usingipykernel 6.29.4
(the latest release) they all crash, using this branch they all work as expected.This PR is opened against the
6.x
branch rather thanmain
as issue #1235 means it is not possible to test anymatplotlib
GUI loops onmain
. It would be good to get this into a release (6.29.5?) as soon as possible and not have to wait for #1235 and the other AnyIO fallout issues to be fixed beforehand. This PR will therefore need to be forward ported tomain
.There is no explicit test for this as you need to actually render a macos window to trigger the failure, and this is not an easy thing to do on headless CI. Essentially this functionality sits in the grey area between
matplotlib
andipython/ipykernel/jupyter
rather than in any individual project.