TMDA Workers,

In a prior message that I posted to tmda-users and received no response to I
outlined a difficulty I was having in getting the DB_BARE_APPEND and
DB_CONFIRM_APPEND queries to work correctly.  In both cases the error was
due to the db_insert routine in the Util.py module of TMDA where the
getattr() function was being called to get the DatabaseError attribute.
However, for some reason this line generated this error (see below for
complete error):

        AttributeError: 'module' object has no attribute 'DatabaseError'

I changed the getattr() function call adding in a default of None on line
759.

Here's a diff of the changes I made:

diff /usr/lib/python2.2/site-packages/TMDA/Util.py Util.py
759c759
<     DatabaseError = getattr(dbmodule, 'DatabaseError')
---
>     DatabaseError = getattr(dbmodule, 'DatabaseError', None)

Can this change be added into the next version of TMDA, or would there be a
more appropriate way to fix this problem?

Dave

"David Grimberg" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> I'm currently using:
>  
> TMDA/1.0.2 "Bold Forbes" (Python/2.2.3 on linux-i686)
> MySQL server version: 3.23.58
> 
> I've got my incoming and ougoing filters working just fine using
from/to-sql
> rules, however, when I try to send to an address not in my lists or
confirm
> a message from a new correspondent, TMDA fails if I have DB_BARE_APPEND or
> DB_CONFIRM_APPEND repectively defined.  In the case of DB_CONFIRM_APPEND I
> get the following error in my debug log:
> 
> ===<Begin Debug Log>===
> Uncaught Python 2.2.3 Exception (Tue Apr 27 14:04:01 2004):
> -----------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/bin/tmda-filter", line 53, in ?
>     execfile(os.path.join(execdir, 'tmda-rfilter'))
>   File "/usr/bin/tmda-rfilter", line 891, in ?
>     main()
>   File "/usr/bin/tmda-rfilter", line 822, in main
>     verify_confirm_cookie(cookie_value, 'accept')
>   File "/usr/bin/tmda-rfilter", line 556, in verify_confirm_cookie
>     params)
>   File "/usr/lib/python2.2/site-packages/TMDA/Util.py", line 759, in
> db_insert
>     DatabaseError = getattr(dbmodule, 'DatabaseError')
> AttributeError: 'module' object has no attribute 'DatabaseError'
> ====<End Debug Log>====
> 
> However, with DB_BARE_APPEND tofmipd just falls over and I get no debug
info
> at all except if I try using pine in the server in which case I get the
> following from pine itself:
> 
> ===<Begin Debug Log>===
> Traceback (most recent call last):
>   File "/usr/bin/tmda-inject", line 457, in ?
>     main()
>   File "/usr/bin/tmda-inject", line 448, in main
>     log_msg)
>   File "/usr/bin/tmda-inject", line 228, in inject_message
>     from_address, to_address)
>   File "/usr/bin/tmda-inject", line 177, in make_field
>     params)
>   File "/usr/lib/python2.2/site-packages/TMDA/Util.py", line 759, in
> db_insert
>     DatabaseError = getattr(dbmodule, 'DatabaseError')
> AttributeError: 'module' object has no attribute 'DatabaseError'
> ====<End Debug Log>====
> 
> Though I still don't get the above debug info in my TMDA debug log.
> 
> Is this a known defect and if so is there a patch for it yet?

_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to