[IPython-user] paste frustrations

Robin robince@gmail....
Wed Mar 4 02:48:18 CST 2009

On Wed, Mar 4, 2009 at 8:21 AM, Ludwig Schwardt
<ludwig.schwardt@gmail.com> wrote:
> Hi,
> As someone who had something to do with readline support for ipython on Mac
> OS X, I cringe every time I hear that word... ("readline", that is :-))
> I share your paste frustration. For the past few months I have had numerous
> mispastes into ipython, usually when pasting large blocks of code, or code
> with complicated indenting and line continuations. I first suspected my
> editor, but never really investigated the problem until now.
> The text you posted at http://www.robince.net/robince/data.txt is a real
> poison pill... When I start up ipython 0.9.1 on Mac OS 10.5.6 and paste this
> text at the terminal prompt, ipython crashes with the message:
> s_push: parser stack overflow
> ---------------------------------------------------------------------------
> MemoryError
> The IPython crash report is available on request.
> I tried pasting the text into System Python 2.5.1, which resulted in
> corrupted text (duplicated text snippets) and a resulting syntax error, but
> no crash. System Python on Mac OS X uses editline, which is a replacement
> for readline, so the problem does not seem to be readline itself. I
> confirmed this by switching off readline in ipython ("readline 0" in
> ipythonrc), which results in the same crash as before.
> The problem therefore seems to be Python itself on Mac OS X...
> Regards,
> Ludwig

I've seen that error too... Thanks very much, it's nice to know it's
not something wrong with my setup.

It seems that the data example is just over some critical length,
because large chunks of it (up to 60 or 70% by eye) paste fine, both
from the beginning and the end of the block - it is only when I paste
the whole lot that this corruption occurs.

To anser Ville - it's definitely not anything to do with the copying
stage... I have copied from a number of different apps (firefox,
macvim, another terminal window) and it is always the same. The text
in the clipboard is not corrupted - it will paste fine anywhere else
(editor, vim in terminal etc.).

In fact the best workaround I have for now (don't know why I didn't
think of it before) is to just use %edit and paste it in there - which
works fine.



More information about the IPython-user mailing list