Merge pull request
#1472 from minrk/ipexec_esc
more general fix for
#662
Previously, the extra readline output was only stripped from the front, but I have recently seen it (Python 3.2, OSX 10.7) elsewhere, so the replacement is now a general re.sub.