If I just paste code into IPython and there is a traceback, it shows me where in the code the exception was raised. But if I use %paste (which is apparently more recommended), it does not do this.
I think just calling self.run_cell instead of going straight to exec should fix it.
Don't forget to use store_history=False if we do this.
Actually, I wonder if we should make that argument default to False: I think the
only places where it needs to be True are when it's called to execute actual
cells of user-input code.
I think that's a good idea - there are only a few places where store_history=True is really what should happen. And it's not at all dangerous to accidentally have store_history=False, whereas inappropriate store_history=True makes a huge mess.
Use run_cell for %paste, instead of plain exec.
Closes gh-865, but introduces test failures for %cpaste
See PR #878.