[Spambayes] Current version

Moore, Paul Paul.Moore@atosorigin.com
Tue Nov 26 10:22:40 2002


From: Neale Pickett [mailto:neale@woozle.org]

> So then, Paul Moore <lists@morpheus.demon.co.uk> is all like:
> 
> > Patch to follow. Is a posting to the list OK, or should I upload it to
> > SF? (No CVS commit ability, and I wouldn't know what to do if I had it
> > :-))
> 
> Yep, patches on the list is fine.  Post away!

OK. Here's a patch. I've taken a simple approach to errors - if the user
puts garbage into the option, the ImportError or AttributeError which gets
generated is just passed back up the call stack. Maybe longer term we
should look at error handling, but I can't find an example of recommended
practice to steal :-)

I tested it via the doctests and a bit of diagnostic printing. I'm taking
the view that if I can create a DBDict successfully, if the code that uses
it doesn't work, I never touched the interface :-) [I'll do some better
testing tonight, when I'm back to my POP3 system, rather than Exchange...]

Paul.

PS Actually, there's another issue with this - it opens up a massive security
   hole, as the user can arrange for an arbitrary module to be imported - and
   an arbitrary function within that module to be run - by changing the INI
   file. This is not good. But I can't think how we could avoid this without
   removing the ability to choose a DBM implementation...

PPS The doctests in dbdict.py need fixing - I'll update them in a separate
    patch once this one has been sorted out. Also, the iterskip argument is
    no longer needed/used. Should it go?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbdict.patch
Type: application/octet-stream
Size: 2586 bytes
Desc: dbdict.patch
Url : http://mail.python.org/pipermail/spambayes/attachments/20021126/454abef4/dbdict.exe


More information about the Spambayes mailing list