From 1745a1c674564ed9770c4e9e0e3b4ddf0e1b1a27 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Aug 31 2010 12:30:54 +0000 Subject: pycolor: wrong filename -> no crash (#628742) --- diff --git a/ipython-0.10-pycolor-wrong-filename.patch b/ipython-0.10-pycolor-wrong-filename.patch new file mode 100644 index 0000000..6418336 --- /dev/null +++ b/ipython-0.10-pycolor-wrong-filename.patch @@ -0,0 +1,32 @@ +Modified patch from upstream (PyColorize.py was moved): +commit 3323d576db9f982be1ef6d66f7b9e0d0d6fef7db +Author: Thomas Spura +Date: Tue Aug 31 14:12:37 2010 +0200 + + pycolor: Wrong filename given -> print error + + When a user wanted to colorize a file, which doesn't exist, IPython + would crash. This commit changes this, so the user gets a usefull + message about the wrong filename. + + This fixes RH bug #628742. + + Signed-off-by: Thomas Spura + +diff --git a/IPython/utils/PyColorize.py b/IPython/utils/PyColorize.py +index 613ae19..1bd9919 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.""" + if fname == '-': + stream = sys.stdin + else: +- stream = file(fname) ++ try: ++ stream = file(fname) ++ except IOError,msg: ++ print msg ++ return + + parser = Parser() + diff --git a/ipython.spec b/ipython.spec index 9a09152..c9cad24 100644 --- a/ipython.spec +++ b/ipython.spec @@ -4,7 +4,7 @@ Name: ipython Version: 0.10 -Release: 7%{?dist} +Release: 8%{?dist} Summary: An enhanced interactive Python shell Group: Development/Libraries @@ -18,6 +18,8 @@ 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 +Patch2: ipython-0.10-pycolor-wrong-filename.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -89,6 +91,7 @@ This package contains the gui of %{name}, which requires wxPython. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 # delete bundling libs pushd IPython/external @@ -204,6 +207,9 @@ rm -rf %{buildroot} %changelog +* Tue Aug 31 2010 Thomas Spura - 0.10-8 +- pycolor: wrong filename -> no crash (#628742) + * Wed Jul 21 2010 David Malcolm - 0.10-7 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild