Conversation
It was unclear why the function check_gtk() was added in the first place, but plt.show() blocked when using "ipython -gthread" without the "-pylab" also, I just want to note here that users will still experience blocking behaviour if they use e.g "ipython -gthread" but their matplotlib is set to some other backend by default (say "WX").
|
Works for me with the GTK backend. For what it's worth, here are my tests pre (972dc9) and post (7fb20b) commit: 972dc9 commit: 972dc9 commit: 972dc9 commit: 972dc9 commit: 972dc9 commit: 972dc9 commit: 7fb20b commit: 7fb20b commit: 7fb20b commit: 7fb20b commit: 7fb20b commit: 7fb20b |
|
This looks promising (Thanks for the tests!) The comments around that code suggest that it had something to do with older versions of pygtk. Can anyone shed light on that? |
|
Thanks, Paul and Mark! Sorry for the long delay in merging... |
The original issue was created by a portion of commit 3e84e9f which I'll refer to as "problematic commit".
My fix185 branch originally undid a portion of the problematic commit, and the outstanding issue relates to other portions of that same commit.
What isn't clear to me is the purpose of the function check_gtk inside Shell.py, which was added in the problematic commit. For some reason, it unconditionally returns mode 'tkthread' if gtk was safely imported and hasattr 'set_interactive', regardless of what mode was passed to it. This "functionality" is not used with the -pylab flag, which is why original one line change did not fix the issue for "ipython -gthread"
I added another commit to the fix185 branch which removes check_gtk() altogether, and see no issues using ipython -gthread, ipython -gthread -pylab, or ipython -pylab. Additionally, the check_gtk() imported gtk regardless of what mode the user selected, and might also be what's been causing the "Why is IPython using X11" threads on the mailing list.
also, I just want to note here that users will see this issue if they use e.g "ipython -gthread" but their matplotlib is set to some other backend by default (say "WX").