Merge lp:~jtaylor/ubuntu/natty/ipython/ipython-fix-777420 into lp:ubuntu/natty/ipython

Proposed by Julian Taylor
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~jtaylor/ubuntu/natty/ipython/ipython-fix-777420
Merge into: lp:ubuntu/natty/ipython
Diff against target: 69 lines (+49/-0)
3 files modified
debian/changelog (+6/-0)
debian/patches/fix_blocking_show.patch (+42/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~jtaylor/ubuntu/natty/ipython/ipython-fix-777420
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Ubuntu branches Pending
Review via email: mp+62311@code.launchpad.net

Description of the change

Description: Fix blocking show
 remove the check for the gtk.set_interactive feature, always available in natty
 the check causes pylab.show() to block
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ipython/+bug/777420
Bug: https://github.com/ipython/ipython/issues/185
Applied-Upstream: 0.10.2
Origin: adapted from https://github.com/ivanov/ipython commits 8ed54e466932c, 7fb20baae1413

TEST CASE 1
cp /etc/matplotlibrc ~/.matplotlib/
# set backend: to GTKAgg in that file
ipython -pylab
plot([1,2])

# plot should show but doesn't
show()
# plot does not show or function blocks
TEST CASE end

from bug 777420 comment 8
TEST CASE2:
 1) install ipython, python-enthoughtbase, mayavi2
 2) Start "ipython -wthread", then use the following two commands:
 from enthought.mayavi import mlab
 mlab.test_contour3d()

=> the GUI window is unresponsive unless the 'show()' command is passed - this is fixed by the new package (see upstream report)
 END TEST CASE

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

To see the fix in action, I just installed ipython and python-matplotlib, then did:

$ ipython -pylab -gthread

at the prompt, hit C-d and watch it hang. With this patch, ipython exits properly. The patch looks fine to me so I think it should be SRU'd. I'm not an ipython user but I couldn't detect any adverse effects from the patch. I'll get the SRU process started and follow up in the bug report. When the new package lands in natty-proposed, please test it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-02-17 17:49:42 +0000
+++ debian/changelog 2011-05-25 14:41:21 +0000
@@ -1,3 +1,9 @@
1ipython (0.10.1-1ubuntu0.1) natty-proposed; urgency=low
2
3 * add patch to fix blocking show (LP: #777420)
4
5 -- Julian Taylor <jtaylor.debian@googlemail.com> Wed, 25 May 2011 13:15:38 +0200
6
1ipython (0.10.1-1) unstable; urgency=low7ipython (0.10.1-1) unstable; urgency=low
28
3 * New upstream release.9 * New upstream release.
410
=== added file 'debian/patches/fix_blocking_show.patch'
--- debian/patches/fix_blocking_show.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix_blocking_show.patch 2011-05-25 14:41:21 +0000
@@ -0,0 +1,42 @@
1Description: Fix blocking show
2 remove the check for the gtk.set_interactive feature, always available in natty
3 the check causes pylab.show() to block
4Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ipython/+bug/777420
5Bug: https://github.com/ipython/ipython/issues/185
6Applied-Upstream: 0.10.2
7Origin: adapted from https://github.com/ivanov/ipython commits 8ed54e466932c, 7fb20baae1413
8Author: Julian Taylor <jtaylor.debian@googlemail.com>
9Index: ipython/IPython/Shell.py
10===================================================================
11--- ipython.orig/IPython/Shell.py 2011-05-25 13:39:01.476670538 +0200
12+++ ipython/IPython/Shell.py 2011-05-25 13:39:30.436670532 +0200
13@@ -778,7 +778,7 @@
14 ## # the user that he has a better option as well.
15 ## # XXX TODO better support when set_interactive is released
16 ## try:
17- ## gtk.set_interactive(False)
18+ gtk.set_interactive(False)
19 ## print "Your PyGtk has set_interactive(), so you can use the"
20 ## print "more stable single-threaded Gtk mode."
21 ## print "See https://bugs.launchpad.net/ipython/+bug/270856"
22@@ -1230,10 +1218,6 @@
23 else:
24 # Any other backend, use plain Tk
25 th_mode = 'tkthread'
26-
27- # New versions of pygtk don't need the brittle threaded support.
28- th_mode = check_gtk(th_mode)
29-
30 return mpl_shell[th_mode]
31 else:
32 # No pylab requested, just plain threads
33@@ -1241,9 +1225,6 @@
34 th_mode = special_opts.pop()
35 except KeyError:
36 th_mode = 'tkthread'
37-
38- # New versions of pygtk don't need the brittle threaded support.
39- th_mode = check_gtk(th_mode)
40 return th_shell[th_mode]
41
42
043
=== modified file 'debian/patches/series'
--- debian/patches/series 2011-02-17 17:49:42 +0000
+++ debian/patches/series 2011-05-25 14:41:21 +0000
@@ -2,3 +2,4 @@
204_remove_shebang.patch204_remove_shebang.patch
305_fix_seteditor_example.patch305_fix_seteditor_example.patch
406_ipythonwx_importerror.patch406_ipythonwx_importerror.patch
5fix_blocking_show.patch

Subscribers

People subscribed via source and target branches

to all changes: