You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using ipython 0.10-1ubuntu1 and Python 2.6.5 on Ubuntu 10.04. The magic command '%edit' does not work on filenames consisted of pure numbers, such as '09.py'. Although numbers following '%edit' are interpreted as lines of previous input, in my opinion, a string like '09.py' should be interpreted as a filename for sure.
HOW TO REPEAT THIS PROBLEM:
$ cat 09.py
#!/usr/bin/python
print "hello"
$ cp 09.py a09.py
$ ls
09.py a09.py
$ ipython
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
...
In [1]: ed -x a09.py
... everything is OK ...
In [2]: ed -x 09.py
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/user/test/ in ()
/usr/lib/pymodules/python2.6/IPython/iplib.pyc in ipmagic(self, arg_s)
1180 else:
1181 magic_args = self.var_expand(magic_args,1)
-> 1182 return fn(magic_args)
1183
1184 def ipalias(self,arg_s):
/usr/lib/pymodules/python2.6/IPython/Magic.py in magic_ed(self, parameter_s)
2127 def magic_ed(self,parameter_s=''):
2128 """Alias to %edit."""
-> 2129 return self.magic_edit(parameter_s)
2130
2131 @testdec.skip_doctest
/usr/lib/pymodules/python2.6/IPython/Magic.py in magic_edit(self, parameter_s, last_call)
2323 # numbers this way. Tough.
2324 ranges = args.split()
-> 2325 data = ''.join(self.extract_input_slices(ranges,opts_r))
2326 elif args.endswith('.py'):
2327 filename = make_filename(args)
/usr/lib/pymodules/python2.6/IPython/Magic.py in extract_input_slices(self, slices, raw)
187 fin += 1
188 else:
--> 189 ini = int(chunk)
190 fin = ini+1
191 cmds.append(hist[ini:fin])
ValueError: invalid literal for int() with base 10: '09.py'
The text was updated successfully, but these errors were encountered:
SUMMARY:
I am using ipython 0.10-1ubuntu1 and Python 2.6.5 on Ubuntu 10.04. The magic command '%edit' does not work on filenames consisted of pure numbers, such as '09.py'. Although numbers following '%edit' are interpreted as lines of previous input, in my opinion, a string like '09.py' should be interpreted as a filename for sure.
HOW TO REPEAT THIS PROBLEM:
The text was updated successfully, but these errors were encountered: