[Patches] [ python-Patches-418613 ] regular expression bug in pipes.py

noreply@sourceforge.net noreply@sourceforge.net
Tue, 24 Apr 2001 11:47:22 -0700


Patches item #418613, was updated on 2001-04-24 11:47
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=418613&group_id=5470

Category: library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeffery D. Collins (tokeneater)
Assigned to: Nobody/Anonymous (nobody)
Summary: regular expression bug in pipes.py

Initial Comment:
I tried running the test() function in pipes.py, but the following exception was raised:

>>> import pipes
>>> t = pipes.Template()
>>> t.append('x $IN $OUT', 'ff')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.1/pipes.py", line 127, in append
    raise ValueError, ValueError: Template.append: missing $IN in cmd
>

After some experimenting, I discovered that the regular expression argument to re.search() contains the character '\b', which is interpreted by the string object as a backspace.  Those strings have now been changed to raw strings to avoid this problem.

I suppose that this module is not widely used.  This problem appears in versions as far back as 1.5.2.




----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=418613&group_id=5470