Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mistyping ed -p breaks ed -p #2466

Closed
doda-zz opened this issue Oct 4, 2012 · 2 comments · Fixed by #2816
Closed

mistyping ed -p breaks ed -p #2466

doda-zz opened this issue Oct 4, 2012 · 2 comments · Fixed by #2816
Labels
Milestone

Comments

@doda-zz
Copy link

doda-zz commented Oct 4, 2012

In [2]: ed
IPython will make a temporary file named: /tmp/ipython_edit_ScaKLT.py
Editing...Waiting for Emacs...
 done. Executing edited code...
Out[2]: '#\n'

In [3]: ed -p
IPython will make a temporary file named: /tmp/ipython_edit_Spe8Xb.py
Editing...Waiting for Emacs...
 done. Executing edited code...
Out[3]: '##\n'

In [4]: ed - p
WARNING: Argument given (- p) can't be found as a variable or as a filename.---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

TypeError: 'NoneType' object is not iterable

In [5]: ed -p
WARNING: Argument given (- p) can't be found as a variable or as a filename.---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

TypeError: 'NoneType' object is not iterable

works correctly until line 4 where it breaks indefinitely, i then have to go back up copy it out and paste into a new edit window. Very annoying, especially when it happens almost every single day for months.

Full Traceback:

WARNING: Argument given (- p) can't be found as a variable or as a filename.---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-f5355427c5e8> in <module>()
----> 1 get_ipython().magic(u'ed - p')

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2155         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2156         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2157         return self.run_line_magic(magic_name, magic_arg_s)
   2158 
   2159     #-------------------------------------------------------------------------

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2081                 args.append(sys._getframe(stack_depth).f_locals)
   2082             with self.builtin_trap:
-> 2083                 result = fn(*args)
   2084             return result
   2085 

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/magics/code.pyc in ed(self, parameter_s)

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    189     # but it's overkill for just that one bit of state.
    190     def magic_deco(arg):
--> 191         call = lambda f, *a, **k: f(*a, **k)
    192 
    193         if callable(arg):

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/magics/code.pyc in ed(self, parameter_s)
    337     def ed(self, parameter_s=''):
    338         """Alias to %edit."""
--> 339         return self.edit(parameter_s)
    340 
    341     @skip_doctest

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/magics/code.pyc in edit(self, parameter_s, last_call)

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    189     # but it's overkill for just that one bit of state.
    190     def magic_deco(arg):
--> 191         call = lambda f, *a, **k: f(*a, **k)
    192 
    193         if callable(arg):

/home/ddd/Dropbox/prog/oth/ipython/IPython/core/magics/code.pyc in edit(self, parameter_s, last_call)
    488         try:
    489             filename, lineno, is_temp = self._find_edit_target(self.shell, 
--> 490                                                        args, opts, last_call)
    491         except MacroToEdit as e:
    492             self._edit_macro(args, e.args[0])

TypeError: 'NoneType' object is not iterable
minrk added a commit to minrk/ipython that referenced this issue Jan 19, 2013
avoids failing calls to `%edit` from killing future `%edit -p`

closes ipython#2466
@minrk
Copy link
Member

minrk commented Jan 19, 2013

try PR #2816

@doda-zz
Copy link
Author

doda-zz commented Jan 20, 2013

Yup this fixes it. Much love ❤️

@doda-zz doda-zz closed this as completed Jan 20, 2013
minrk added a commit to minrk/ipython that referenced this issue Jan 26, 2013
avoids failing calls to `%edit` from killing future `%edit -p`

closes ipython#2466
minrk added a commit that referenced this issue Mar 5, 2013
…succeeded

avoids failing calls to `%edit` from killing future `%edit -p`

closes #2466
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
avoids failing calls to `%edit` from killing future `%edit -p`

closes ipython#2466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants