Tim Legant wrote: > Ugh. And this has been around a long time, too. No new code uses > string module functions; string methods are faster and don't require > the module import. We've deliberately moved away from importing > string since we discontinued support for the Python 1.x line. I think > a lot of us use a separate file for auto-confirmations and don't > bother commenting it, which is why we haven't found this.
I don't use a separate file because I have 'bare=append' as my default action (via an X-TMDA header), and got tired of de-duping the BARE_APPEND file. Yes, I know that there's a (slight) possibility of corruption, but that's what backups are for. >> The following patch fixes what I believe is inconsistent behavior by >> stripping inline comments from both strings in append_to_file, to >> ensure that the same address won't get added twice. > > Strictly speaking, I don't thing comment-stripping 'str' is necessary, > since it is always just an email address, but it doesn't hurt and the > code is safer that way, should anyone try to use it for something > other than the implementation of the XXX_APPEND features. I did it because I used to have a personal patch (I mentioned it on one of the lists, but no one else seemed interested) that allowed me to add comments from the X-TMDA line. Something like "bare=append-keyword-foo" to add the address with " # foo", or "bare=append-dated" to add it with " # 20030903". I stopped applying the patch because I never actually remembered to use it, but had it in mind when I added the comment stripping for 'str'. Plus, like you said, it doesn't hurt. >> I think this is a bugfix rather than a new feature, so hopefully this >> can be accepted for 1.0. > > I'll change the "string.lower(bare)" to "bare.lower()" and check it > in. I didn't know about the string module function versus string method thing. I'll keep it in mind for future reference. > Thanks for the good catch. Glad to help. Ed _________________________________________________ tmda-workers mailing list ([EMAIL PROTECTED]) http://tmda.net/lists/listinfo/tmda-workers
