[spambayes-dev] Patch for pop3proxy

papaDoc papaDoc at videotron.ca
Mon Aug 25 11:17:38 EDT 2003


Hi,

I have this problem with pop3proxy.py (cvs of 2003.08.25) and python 2.2.2

SpamBayes POP3 Proxy Beta1, version 0.1 (May 2003),
using SpamBayes POP3 Proxy Web Interface Alpha2, version 0.02
and engine SpamBayes Beta2, version 0.2 (July 2003).

Loading database... Filename for database = 
d:/NoBackup/users/ricard/Spambayes/hammie.db
Traceback (most recent call last):
  File "C:\Devtools\SPAMBA~1\SPAMBA~2.25\POP3PR~1.PY", line 819, in ?
    run()
  File "C:\Devtools\SPAMBA~1\SPAMBA~2.25\POP3PR~1.PY", line 804, in run
    prepare(state=state)
  File "C:\Devtools\SPAMBA~1\SPAMBA~2.25\POP3PR~1.PY", line 746, in prepare
    state.createWorkers()
  File "C:\Devtools\SPAMBA~1\SPAMBA~2.25\POP3PR~1.PY", line 614, in 
createWorkers
    if '::' in filename:
TypeError: 'in <string>' requires character as left operand


So this is a patch to solve this problem
***************
*** 611,617 ****
          filename = os.path.expanduser(filename)
          print "Filename for database = %s" % filename
          if self.useDB:
!             if re.search(r'::', filename):
                  sql_types = {"pgsql" : storage.PGClassifier,
                               "mysql" : storage.mySQLClassifier,
                               }
--- 611,617 ----
          filename = os.path.expanduser(filename)
          print "Filename for database = %s" % filename
          if self.useDB:
!             if '::' in filename:
                  sql_types = {"pgsql" : storage.PGClassifier,
                               "mysql" : storage.mySQLClassifier,
                               }



I don't know if this is the good way to do it but it solves my 
problem.......

Remi




More information about the spambayes-dev mailing list