add fix for #646079 and use upstream fix for #628742

This commit is contained in:
Thomas Spura 2010-11-15 03:06:10 +01:00
parent 3f640e99e5
commit a34b15ba5d
3 changed files with 52 additions and 7 deletions

37
ipython-0.10-no-gtk.patch Normal file
View File

@ -0,0 +1,37 @@
commit 8161523536289eaed01ca42707f6785f59343cd7
Author: Fernando Perez <Fernando.Perez@berkeley.edu>
Date: Tue Oct 26 14:32:10 2010 -0700
Do not require GTK to be either present or usable to start.
Before, we only checked that we could import GTK, but in a linux
console, it's possible to import it while not being able to start it
(no X11 present).
This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=646079
Thanks to Tom Spura for reporting it.
diff --git a/IPython/Shell.py b/IPython/Shell.py
index 9481099..38006d7 100644
--- a/IPython/Shell.py
+++ b/IPython/Shell.py
@@ -1152,7 +1152,8 @@ class IPShellMatplotlibQt4(IPShellQt4):
def check_gtk(mode):
try:
import gtk
- except ImportError:
+ except (ImportError, RuntimeError):
+ # GTK not present, or can't be started (no X11, happens in console)
return mode
if hasattr(gtk,'set_interactive'):
gtk.set_interactive(False)
@@ -1243,7 +1244,8 @@ def _select_shell(argv):
th_mode = 'tkthread'
# New versions of pygtk don't need the brittle threaded support.
- th_mode = check_gtk(th_mode)
+ if th_mode == 'gthread':
+ th_mode = check_gtk(th_mode)
return th_shell[th_mode]

View File

@ -1,7 +1,7 @@
Modified patch from upstream (PyColorize.py was moved):
commit 3323d576db9f982be1ef6d66f7b9e0d0d6fef7db
commit e5effe0eb43d57e3a34a9dd07a0c03e3a178b2f2
Author: Thomas Spura <tomspur@fedoraproject.org>
Date: Tue Aug 31 14:12:37 2010 +0200
Date: Tue Nov 2 10:19:58 2010 +0100
pycolor: Wrong filename given -> print error
@ -14,7 +14,7 @@ Date: Tue Aug 31 14:12:37 2010 +0200
Signed-off-by: Thomas Spura <tomspur@fedoraproject.org>
diff --git a/IPython/utils/PyColorize.py b/IPython/utils/PyColorize.py
index 613ae19..1bd9919 100644
index 613ae19..ddf3f7a 100644
--- a/IPython/PyColorize.py
+++ b/IPython/PyColorize.py
@@ -277,7 +277,11 @@ If no filename is given, or if filename is -, read standard input."""
@ -25,8 +25,8 @@ index 613ae19..1bd9919 100644
+ try:
+ stream = file(fname)
+ except IOError,msg:
+ print msg
+ return
+ print >> sys.stderr, msg
+ sys.exit(1)
parser = Parser()

View File

@ -4,7 +4,7 @@
Name: ipython
Version: 0.10.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: An enhanced interactive Python shell
Group: Development/Libraries
@ -18,8 +18,12 @@ Source0: http://ipython.scipy.org/dist/%{name}-%{version}.tar.gz
Patch0: %{name}-itpl-external.patch
# unbundle all current libraries, a similar patch submitted upstream
Patch1: %{name}-unbundle-external-module.patch
# fix for #628742, published on github for inclusion into upstream
# fix for #628742, will be in 0.11
Patch2: ipython-0.10-pycolor-wrong-filename.patch
# fix for #646079, will be in 0.11
Patch3: ipython-0.10-no-gtk.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@ -116,6 +120,7 @@ mv validate.py validate/_validate.py
popd
%patch1 -p1
%patch2 -p1
%patch3 -p1
# delete bundling libs
pushd IPython/external
@ -231,6 +236,9 @@ rm -rf %{buildroot}
%changelog
* Mon Nov 15 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.10.1-3
- add fix for #646079 and use upstream fix for #628742
* Mon Oct 18 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.10.1-2
- argparse is in python 2.7 and 3.2