[Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.42,1.43

Tony Meyer anadelonbrin at users.sourceforge.net
Mon Mar 15 18:25:37 EST 2004


Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3202/spambayes

Modified Files:
	ProxyUI.py 
Log Message:
Fix [ 906581 ] Assertion failed in search subject

Can an email message's items/headers be non-strings?  It appears from
the bug report that this must be the case, although I'm not sure what would
cause that to be so.  The email package's documentation is very difficult (for me)
to make sense of, so I'm not really sure.

In any case, forcing them to strings won't hurt really, except that a search might
be a bit slower (but that's a rare occurence).

Index: ProxyUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** ProxyUI.py	5 Feb 2004 09:33:02 -0000	1.42
--- ProxyUI.py	15 Mar 2004 23:25:24 -0000	1.43
***************
*** 467,473 ****
                              msg.load()
                              if params.has_key('subject'):
!                                 if self._contains(msg['Subject'], key, ic):
                                      push((k, corp))
                              if params.has_key('body'):
                                  msg_body = msg.as_string()
                                  msg_body = msg_body[msg_body.index('\r\n\r\n'):]
--- 467,476 ----
                              msg.load()
                              if params.has_key('subject'):
!                                 subj = str(msg['Subject'])
!                                 if self._contains(subj, key, ic):
                                      push((k, corp))
                              if params.has_key('body'):
+                                 # For [ 906581 ] Assertion failed in search
+                                 # subject.  Can the headers be a non-string?
                                  msg_body = msg.as_string()
                                  msg_body = msg_body[msg_body.index('\r\n\r\n'):]
***************
*** 476,479 ****
--- 479,487 ----
                              if params.has_key('headers'):
                                  for nm, val in msg.items():
+                                     # For [ 906581 ] Assertion failed in
+                                     # search subject.  Can the headers be
+                                     # a non-string?
+                                     nm = str(nm)
+                                     val = str(val)
                                      if self._contains(nm, key, ic) or \
                                         self._contains(val, key, ic):




More information about the Spambayes-checkins mailing list