Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 <>
  • Loading branch information...
commit 5c4429abba600a474defdfed40eacf45dc076971 1 parent bd2a307
Thomas Spura authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 IPython/utils/
6 IPython/utils/
@@ -277,7 +277,11 @@ def main(argv=None):
if fname == '-':
stream = sys.stdin
- stream = file(fname)
+ try:
+ stream = file(fname)
+ except IOError,msg:
+ print >> sys.stderr, msg
+ sys.exit(1)
parser = Parser()
Please sign in to comment.
Something went wrong with that request. Please try again.