[IPython-dev] iplib fix (#1)
Dan Milstein
danmil at comcast.net
Fri Mar 2 09:39:05 EST 2007
Fernando (/Alex),
Attached is a patch to the most recent version of iplib which fixes
the problem reported. Let's call it fix #1 because it doesn't
represent the full overhaul of prefilter which is oh-so-close ;-).
Also attached is a patch to test_prefilter.py so that it captures
this problem (thanks to Alex's detailed report).
The change is just in the first part of the line_split regex, from:
self.line_split = re.compile(r'^([\s*,;/])'
To:
self.line_split = re.compile(r'^(\s*[,;/]?\s*)'
The \s* doesn't work inside the [] (special chars are turned off, so
that matches a '*' or a single whitespace), so the match was failing
when it shouldn't, and falling back on whitespace splitting. Now
that first part can match whitespace optionally mixed with a single
autocall esc char.
This, um, fixed the problem, though I wouldn't swear as to *how* (see
note about full rewrite above).
-Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_prefilter.py.patch
Type: application/octet-stream
Size: 562 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070302/4eee0bff/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iplib.py.patch
Type: application/octet-stream
Size: 1068 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070302/4eee0bff/attachment-0001.obj>
More information about the IPython-dev
mailing list