
May 11, 2006
9:53 p.m.
Mark Sapiro wrote:
Rob Jackson wrote:
<snip>
- pl = msg.get_payload(decode=True)
- re.sub('AZ', 'new text', pl)
- msg.set_payload(pl) <snip>
It looks OK to me.
Actually, it's not OK. I overlooked the fact that Python strings are immutable and re.sub doesn't (can't) change them in place. Thus,
re.sub('AZ', 'new text', pl)
needs to be
pl = re.sub('AZ', 'new text', pl)
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan