FS#29476 - [ipython3] "%run -d" doesn't work in python3

Attached to Project: Community Packages
Opened by Oleksandr (cross) - Sunday, 15 April 2012, 21:12 GMT
Last edited by Kyle Keen (keenerd) - Monday, 16 April 2012, 14:10 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Kyle Keen (keenerd)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

...
NOTE: Enter 'c' at the ipdb> prompt to start your script.
> <string>(1)<module>()

ipdb> w
/usr/lib/python3.2/bdb.py(392)run()
390 sys.settrace(self.trace_dispatch)
391 try:
--> 392 exec(cmd, globals, locals)
393 except BdbQuit:
394 pass

> <string>(1)<module>()

ipdb> c
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
NameError: name 'execfile' is not defined


Additional info:
* package version - ipython 0.12-2


Steps to reproduce:

ipython
%run -d <source.py>

Confirmed patch (https://github.com/takluyver/ipython/commit/3e1a50920938062a78c3dbab83366dc50c1f2d2d):

IPython/core/magic.py

@@ -1786,8 +1786,9 @@ def magic_run(self, parameter_s ='', runner=None,
# Start file run
print "NOTE: Enter 'c' at the",
print "%s prompt to start your script." % deb.prompt
+ ns = {'execfile': py3compat.execfile, 'prog_ns': prog_ns}
try:
- deb.run('execfile("%s")' % filename, prog_ns)
+ deb.run('execfile("%s", prog_ns)' % filename, ns)
except:
etype, value, tb = sys.exc_info()
This task depends upon

Closed by  Kyle Keen (keenerd)
Monday, 16 April 2012, 14:10 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in ipython-0.12-4

Loading...