juliantaylor/ipython — comment on commit e68660659803dfc67b3d05e89f8b3013f6a11cae
File: IPython/frontend/terminal/interactiveshell.py line 241
By takluyver:

Ah, no, you're right. I'd forgotten we were restoring the history based on source_raw, rather than on the lines that we've pulled out from readline. Thanks.