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

Subscribers

People subscribed via source and target branches

to all changes: