diff --git a/IPython/iplib.py b/IPython/iplib.py index 3e3ebef..5fb394b 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.3 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 2195 2007-04-02 05:35:16Z fperez $ +$Id: iplib.py 2196 2007-04-02 06:02:16Z fperez $ """ #***************************************************************************** @@ -2571,7 +2571,14 @@ want to merge them back into the new files.""" % locals() print >> sys.stderr, badline else: # regular file execution try: - execfile(fname,*where) + if sys.platform == 'win32': + # Work around a bug in Python for Windows. The bug was + # fixed in in Python 2.5 r54159 and 54158, but that's still + # SVN Python as of March/07. For details, see: + # http://projects.scipy.org/ipython/ipython/ticket/123 + exec file(fname) in where[0],where[1] + else: + execfile(fname,*where) except SyntaxError: self.showsyntaxerror() warn('Failure executing file: <%s>' % fname) diff --git a/doc/ChangeLog b/doc/ChangeLog index d3d0c69..c4d00e2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2007-04-02 Fernando Perez + + * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to + protect against a bug in Python's execfile(). Closes #123. + 2007-04-01 Fernando Perez * IPython/iplib.py (split_user_input): ensure that when splitting