[Spambayes-checkins] SF.net SVN: spambayes:[3230] trunk/spambayes

montanaro at users.sourceforge.net montanaro at users.sourceforge.net
Tue Jan 27 12:25:19 CET 2009


Revision: 3230
          http://spambayes.svn.sourceforge.net/spambayes/?rev=3230&view=rev
Author:   montanaro
Date:     2009-01-27 11:25:19 +0000 (Tue, 27 Jan 2009)

Log Message:
-----------
Assume Python 2.4 or greater.

  * Move bsddb, md5 compatibility to new spambayes.port module.  (Probably
    more to do in this regard.)
  * Assume presence of many modules and builtins: textwrap, cStringIO,
    __file__, True, False, set, heapq, csv, enumerate, reversed.  This
    allows us to remove lots of try/import/except cruft.

Also, remove all support for Berkeley DB v1.85 databases.

Modified Paths:
--------------
    trunk/spambayes/Outlook2000/dialogs/dialog_map.py
    trunk/spambayes/Outlook2000/dialogs/wizard_processors.py
    trunk/spambayes/Outlook2000/docs/setup.py
    trunk/spambayes/Outlook2000/manager.py
    trunk/spambayes/Outlook2000/msgstore.py
    trunk/spambayes/contrib/pycksum.py
    trunk/spambayes/contrib/tte.py
    trunk/spambayes/scripts/core_server.py
    trunk/spambayes/scripts/sb_dbexpimp.py
    trunk/spambayes/scripts/sb_pop3dnd.py
    trunk/spambayes/scripts/sb_server.py
    trunk/spambayes/spambayes/CoreUI.py
    trunk/spambayes/spambayes/Dibbler.py
    trunk/spambayes/spambayes/ImageStripper.py
    trunk/spambayes/spambayes/OptionsClass.py
    trunk/spambayes/spambayes/ProxyUI.py
    trunk/spambayes/spambayes/PyMeldLite.py
    trunk/spambayes/spambayes/TestDriver.py
    trunk/spambayes/spambayes/UserInterface.py
    trunk/spambayes/spambayes/classifier.py
    trunk/spambayes/spambayes/core_resources/__init__.py
    trunk/spambayes/spambayes/core_resources/scanning__init__.py
    trunk/spambayes/spambayes/dbmstorage.py
    trunk/spambayes/spambayes/i18n.py
    trunk/spambayes/spambayes/languages/de/__init__.py
    trunk/spambayes/spambayes/languages/es/__init__.py
    trunk/spambayes/spambayes/languages/es_AR/__init__.py
    trunk/spambayes/spambayes/languages/fr/__init__.py
    trunk/spambayes/spambayes/resources/__init__.py
    trunk/spambayes/spambayes/resources/scanning__init__.py
    trunk/spambayes/spambayes/test/test_basic_import.py
    trunk/spambayes/spambayes/test/test_message.py
    trunk/spambayes/spambayes/test/test_programs.py
    trunk/spambayes/spambayes/test/test_sb_dbexpimp.py
    trunk/spambayes/spambayes/test/test_sb_filter.py
    trunk/spambayes/spambayes/test/test_sb_imapfilter.py
    trunk/spambayes/spambayes/test/test_storage.py
    trunk/spambayes/spambayes/tokenizer.py
    trunk/spambayes/testtools/mboxtest.py
    trunk/spambayes/utilities/loosecksum.py
    trunk/spambayes/utilities/splitndirs.py
    trunk/spambayes/utilities/which_database.py
    trunk/spambayes/windows/pop3proxy_service.py
    trunk/spambayes/windows/pop3proxy_tray.py

Added Paths:
-----------
    trunk/spambayes/failing-unit-tests.txt
    trunk/spambayes/spambayes/port.py

Modified: trunk/spambayes/Outlook2000/dialogs/dialog_map.py
===================================================================
--- trunk/spambayes/Outlook2000/dialogs/dialog_map.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/Outlook2000/dialogs/dialog_map.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -8,12 +8,6 @@
 
 from dialogs import ShowDialog, MakePropertyPage, ShowWizard
 
-try:
-    enumerate
-except NameError:   # enumerate new in 2.3
-    def enumerate(seq):
-        return [(i, seq[i]) for i in xrange(len(seq))]
-
 # "dialog specific" processors:
 class StatsProcessor(ControlProcessor):
     def __init__(self, window, control_ids):

Modified: trunk/spambayes/Outlook2000/dialogs/wizard_processors.py
===================================================================
--- trunk/spambayes/Outlook2000/dialogs/wizard_processors.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/Outlook2000/dialogs/wizard_processors.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -7,12 +7,6 @@
 import win32gui, win32con, win32api, commctrl
 from dialogs import ShowDialog, MakePropertyPage
 
-try:
-    enumerate
-except NameError:   # enumerate new in 2.3
-    def enumerate(seq):
-        return [(i, seq[i]) for i in xrange(len(seq))]
-
 import processors
 import opt_processors
 import async_processor

Modified: trunk/spambayes/Outlook2000/docs/setup.py
===================================================================
--- trunk/spambayes/Outlook2000/docs/setup.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/Outlook2000/docs/setup.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -19,14 +19,6 @@
 import sys
 
 # Fix path so we can import from Outlook2000 directory.
-try:
-    __file__
-except NameError:
-    # Create __file__ for Python 2.2
-    __file__ = sys.argv[0]
-# Fix __file__ for Python 2.2 & 2.3
-__file__ = os.path.abspath(__file__)
-    
 sys.path.append(os.path.dirname(os.path.dirname(__file__)))
 
 import config

Modified: trunk/spambayes/Outlook2000/manager.py
===================================================================
--- trunk/spambayes/Outlook2000/manager.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/Outlook2000/manager.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -69,10 +69,7 @@
     assert sys.frozen == "dll", "outlook only supports inproc servers"
     this_filename = win32api.GetModuleFileName(sys.frozendllhandle)
 else:
-    try:
-        this_filename = os.path.abspath(__file__)
-    except NameError: # no __file__ - means Py2.2 and __name__=='__main__'
-        this_filename = os.path.abspath(sys.argv[0])
+    this_filename = os.path.abspath(__file__)
 
 # Ensure that a bsddb module is available if we are frozen.
 # See if we can use the new bsddb module. (The old one is unreliable

Modified: trunk/spambayes/Outlook2000/msgstore.py
===================================================================
--- trunk/spambayes/Outlook2000/msgstore.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/Outlook2000/msgstore.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -24,11 +24,6 @@
 import pythoncom
 import winerror
 
-try:
-    PR_USERFIELDS # only in new win32all
-except NameError:
-    PR_USERFIELDS = 0x36E30102 # PROP_TAG(PT_BINARY, 0x36e3)
-
 # Additional MAPI constants we dont have in Python
 MESSAGE_MOVE = 0x1 # from MAPIdefs.h
 MSGFLAG_READ = 0x1 # from MAPIdefs.h

Modified: trunk/spambayes/contrib/pycksum.py
===================================================================
--- trunk/spambayes/contrib/pycksum.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/contrib/pycksum.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -39,10 +39,7 @@
 import sys
 import email.Parser
 import email.generator
-try:
-    from hashlib import md5
-except ImportError:
-    from md5 import new as md5
+
 import anydbm
 import re
 import time
@@ -51,6 +48,8 @@
 except ImportError:
     import StringIO
 
+from spambayes.port import md5
+
 def clean(data):
     """Clean the obviously variable stuff from a chunk of data.
 

Modified: trunk/spambayes/contrib/tte.py
===================================================================
--- trunk/spambayes/contrib/tte.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/contrib/tte.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -89,15 +89,6 @@
         print >> sys.stderr, msg
     print >> sys.stderr, __doc__.strip() % globals()
 
-try:
-    reversed
-except NameError:
-    def reversed(seq):
-        seq = seq[:]
-        seq.reverse()
-        return iter(seq)
-
-
 def train(store, hambox, spambox, maxmsgs, maxrounds, tdict, reverse, verbose,
           ratio):
     round = 0

Added: trunk/spambayes/failing-unit-tests.txt
===================================================================
--- trunk/spambayes/failing-unit-tests.txt	                        (rev 0)
+++ trunk/spambayes/failing-unit-tests.txt	2009-01-27 11:25:19 UTC (rev 3230)
@@ -0,0 +1,1116 @@
+spambayes.Tester.Test.reset_test_results ... ok
+test_basic_import.test_basic_import ... ERROR
+test_sb_server_default (test_programs.TestServer) ... port ('', 8880) in use
+SpamBayes POP3 Proxy Version 1.1b1 (November 23, 2008)
+
+Loading database...
+Traceback (most recent call last):
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 1088, in <module>
+    run()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 1082, in run
+    start()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 1018, in start
+    main(state.servers, state.proxyPorts, state.uiPort, state.launchUI)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 995, in main
+    httpServer = UserInterfaceServer(uiPort)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/spambayes/UserInterface.py", line 110, in __init__
+    Dibbler.HTTPServer.__init__(self, uiPort)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/spambayes/Dibbler.py", line 319, in __init__
+    (self, context), context._map)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/spambayes/Dibbler.py", line 283, in __init__
+    self.bind(port)
+  File "/Users/skip/local/lib/python2.7/asyncore.py", line 322, in bind
+    return self.socket.bind(addr)
+  File "<string>", line 1, in bind
+socket.error: [Errno 48] Address already in use
+FAIL
+test_sb_server_restore (test_programs.TestServer) ... port ('', 8880) in use
+SpamBayes POP3 Proxy Version 1.1b1 (November 23, 2008)
+
+Loading database...
+Traceback (most recent call last):
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 1088, in <module>
+    run()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 1082, in run
+    start()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 1018, in start
+    main(state.servers, state.proxyPorts, state.uiPort, state.launchUI)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_server.py", line 995, in main
+    httpServer = UserInterfaceServer(uiPort)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/spambayes/UserInterface.py", line 110, in __init__
+    Dibbler.HTTPServer.__init__(self, uiPort)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/spambayes/Dibbler.py", line 319, in __init__
+    (self, context), context._map)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/spambayes/Dibbler.py", line 283, in __init__
+    self.bind(port)
+  File "/Users/skip/local/lib/python2.7/asyncore.py", line 322, in bind
+    return self.socket.bind(addr)
+  File "<string>", line 1, in bind
+socket.error: [Errno 48] Address already in use
+FAIL
+test_sb_server_ui_port (test_programs.TestServer) ... FAIL
+test_Filter (test_sb_imapfilter.IMAPFilterTest) ... ERROR
+test_Train (test_sb_imapfilter.IMAPFilterTest) ... ERROR
+test_Filter (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_Train (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_cmp (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_generate_id (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_getitem_new_id (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_getitem_new_style (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_getitem_old_style (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_iter (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+test_keys (test_sb_imapfilter.IMAPFolderTest) ... ERROR
+testMoveTo (test_sb_imapfilter.IMAPMessageTest) ... ERROR
+test_Save (test_sb_imapfilter.IMAPMessageTest) ... ERROR
+test_as_string_invalid (test_sb_imapfilter.IMAPMessageTest) ... ERROR
+test_extract_time_bad_date (test_sb_imapfilter.IMAPMessageTest) ... ERROR
+test_extract_time_date (test_sb_imapfilter.IMAPMessageTest) ... FAIL
+ERROR
+test_extract_time_no_date (test_sb_imapfilter.IMAPMessageTest) ... ERROR
+test_get_bad_message (test_sb_imapfilter.IMAPMessageTest) ... FAIL
+ERROR
+test_get_full_message (test_sb_imapfilter.IMAPMessageTest) ... FAIL
+ERROR
+test_get_memory_error_message (test_sb_imapfilter.IMAPMessageTest) ... ERROR
+testBadLogin (test_sb_imapfilter.IMAPSessionTest) ... FAIL
+ERROR
+testConnection (test_sb_imapfilter.IMAPSessionTest) ... FAIL
+ERROR
+testGoodLogin (test_sb_imapfilter.IMAPSessionTest) ... FAIL
+ERROR
+testSelectFolder (test_sb_imapfilter.IMAPSessionTest) ... FAIL
+ERROR
+test_check_response (test_sb_imapfilter.IMAPSessionTest) ... ERROR
+test_extract_fetch_data (test_sb_imapfilter.IMAPSessionTest) ... ERROR
+test_folder_list (test_sb_imapfilter.IMAPSessionTest) ... FAIL
+ERROR
+test_safe_read (test_sb_imapfilter.IMAPSessionTest) ... ERROR
+ERROR
+test_UI (test_sb_imapfilter.InterfaceTest) ... option --verbose not recognized
+
+An IMAP filter.  An IMAP message box is scanned and all non-scored
+messages are scored and (where necessary) filtered.
+
+Usage:
+    sb_imapfilter [options]
+
+        note: option values with spaces in them must be enclosed
+              in double quotes
+
+        options:
+            -p  dbname  : pickled training database filename
+            -d  dbname  : dbm training database filename
+            -t          : train contents of spam folder and ham folder
+            -c          : classify inbox
+            -h          : display this message
+            -v          : verbose mode
+            -P          : security option to prompt for imap password,
+                          rather than look in options["imap", "password"]
+            -e y/n      : expunge/purge messages on exit (y) or not (n)
+            -i debuglvl : a somewhat mysterious imaplib debugging level
+                          (4 is a good level, and suitable for bug reports)
+            -l minutes  : period of time between filtering operations
+            -b          : Launch a web browser showing the user interface.
+            -o section:option:value :
+                          set [section, option] in the options database
+                          to value
+
+Examples:
+
+    Classify inbox, with dbm database
+        sb_imapfilter -c -d bayes.db
+
+    Train Spam and Ham, then classify inbox, with dbm database
+        sb_imapfilter -t -c -d bayes.db
+
+    Train Spam and Ham only, with pickled database
+        sb_imapfilter -t -p bayes.db
+
+Warnings:
+    o We never delete mail, unless you use the -e/purge option, but we do
+      mark a lot as deleted, and your mail client might remove that for
+      you.  We try to only mark as deleted once the moved/altered message
+      is correctly saved, but things might go wrong.  We *strongly*
+      recommend that you try this script out on mail that you can recover
+      from somewhere else, at least at first.
+
+FAIL
+test_802545 (test_sb_imapfilter.SFBugsTest) ... ERROR
+test_816400 (test_sb_imapfilter.SFBugsTest) ... ERROR
+test_818552 (test_sb_imapfilter.SFBugsTest) ... ERROR
+test_842984 (test_sb_imapfilter.SFBugsTest) ... ERROR
+test_886133 (test_sb_imapfilter.SFBugsTest) ... ERROR
+test_direct_connection (test_smtpproxy.SMTPProxyTest) ... ERROR
+test_disconnection (test_smtpproxy.SMTPProxyTest) ... ERROR
+test_ham_intercept (test_smtpproxy.SMTPProxyTest) ... ERROR
+test_proxy_connection (test_smtpproxy.SMTPProxyTest) ... ERROR
+test_sendmessage (test_smtpproxy.SMTPProxyTest) ... ERROR
+testCounts (test_storage.CDBStorageTestCase) ... ok
+testHapax (test_storage.CDBStorageTestCase) ... ok
+testLoadAndStore (test_storage.CDBStorageTestCase) ... ok
+test_bug777026 (test_storage.CDBStorageTestCase) ... ok
+testCounts (test_storage.DBStorageTestCase) ... ERROR
+testHapax (test_storage.DBStorageTestCase) ... ERROR
+testLoadAndStore (test_storage.DBStorageTestCase) ... ERROR
+testNoDBMAvailable (test_storage.DBStorageTestCase) ... ERROR
+test_bug777026 (test_storage.DBStorageTestCase) ... ERROR
+testCounts (test_storage.PickleStorageTestCase) ... ok
+testHapax (test_storage.PickleStorageTestCase) ... FAIL
+testLoadAndStore (test_storage.PickleStorageTestCase) ... FAIL
+test_bug777026 (test_storage.PickleStorageTestCase) ... ok
+testCounts (test_storage.ZODBStorageTestCase) ... ok
+testHapax (test_storage.ZODBStorageTestCase) ... ok
+testLoadAndStore (test_storage.ZODBStorageTestCase) ... ok
+test_bug777026 (test_storage.ZODBStorageTestCase) ... ok
+
+======================================================================
+ERROR: test_basic_import.test_basic_import
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/local/lib/python2.7/site-packages/nose-0.10.4-py2.7.egg/nose/case.py", line 182, in runTest
+    self.test(*self.arg)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_basic_import.py", line 36, in test_basic_import
+    from spambayes import optimize
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/optimize.py", line 9, in <module>
+    import Numeric
+ImportError: No module named Numeric
+
+======================================================================
+ERROR: test_Filter (test_sb_imapfilter.IMAPFilterTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 756, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_Train (test_sb_imapfilter.IMAPFilterTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 756, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_Filter (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_Train (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_cmp (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_generate_id (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_getitem_new_id (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_getitem_new_style (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_getitem_old_style (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_iter (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_keys (test_sb_imapfilter.IMAPFolderTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 669, in setUp
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: testMoveTo (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_Save (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_as_string_invalid (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_extract_time_bad_date (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_extract_time_date (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: test_extract_time_no_date (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_get_bad_message (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: test_get_full_message (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: test_get_memory_error_message (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: testBadLogin (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: testConnection (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: testGoodLogin (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: testSelectFolder (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: test_check_response (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_extract_fetch_data (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_folder_list (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: test_safe_read (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 547, in test_safe_read
+    saved_file = self.imap.file
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_safe_read (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+
+======================================================================
+ERROR: test_802545 (test_sb_imapfilter.SFBugsTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_816400 (test_sb_imapfilter.SFBugsTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_818552 (test_sb_imapfilter.SFBugsTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_842984 (test_sb_imapfilter.SFBugsTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_886133 (test_sb_imapfilter.SFBugsTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 334, in tearDown
+    self.imap.logout()
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 284, in logout
+    BaseIMAP.logout(self)  # superclass logout
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 531, in logout
+    self.shutdown()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 251, in shutdown
+    self.file.close()
+  File "/Users/skip/local/lib/python2.7/imaplib.py", line 214, in __getattr__
+    raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
+AttributeError: Unknown IMAP4 command: 'file'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+ERROR: test_direct_connection (test_smtpproxy.SMTPProxyTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_smtpproxy.py", line 194, in test_direct_connection
+    smtpServer.connect(('localhost', 8025))
+  File "<string>", line 1, in connect
+error: [Errno 61] Connection refused
+
+======================================================================
+ERROR: test_disconnection (test_smtpproxy.SMTPProxyTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_smtpproxy.py", line 227, in test_disconnection
+    proxy.connect(('localhost', 8025))
+  File "<string>", line 1, in connect
+error: [Errno 61] Connection refused
+
+======================================================================
+ERROR: test_ham_intercept (test_smtpproxy.SMTPProxyTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_smtpproxy.py", line 255, in test_ham_intercept
+    s = smtplib.SMTP('localhost', 8026)
+  File "/Users/skip/local/lib/python2.7/smtplib.py", line 239, in __init__
+    (code, msg) = self.connect(host, port)
+  File "/Users/skip/local/lib/python2.7/smtplib.py", line 295, in connect
+    self.sock = self._get_socket(host, port, self.timeout)
+  File "/Users/skip/local/lib/python2.7/smtplib.py", line 273, in _get_socket
+    return socket.create_connection((port, host), timeout)
+  File "/Users/skip/local/lib/python2.7/socket.py", line 512, in create_connection
+    raise error, msg
+error: [Errno 61] Connection refused
+
+======================================================================
+ERROR: test_proxy_connection (test_smtpproxy.SMTPProxyTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_smtpproxy.py", line 211, in test_proxy_connection
+    proxy.connect(('localhost', 8026))
+  File "<string>", line 1, in connect
+error: [Errno 61] Connection refused
+
+======================================================================
+ERROR: test_sendmessage (test_smtpproxy.SMTPProxyTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_smtpproxy.py", line 249, in test_sendmessage
+    s = smtplib.SMTP('localhost', 8026)
+  File "/Users/skip/local/lib/python2.7/smtplib.py", line 239, in __init__
+    (code, msg) = self.connect(host, port)
+  File "/Users/skip/local/lib/python2.7/smtplib.py", line 295, in connect
+    self.sock = self._get_socket(host, port, self.timeout)
+  File "/Users/skip/local/lib/python2.7/smtplib.py", line 273, in _get_socket
+    return socket.create_connection((port, host), timeout)
+  File "/Users/skip/local/lib/python2.7/socket.py", line 512, in create_connection
+    raise error, msg
+error: [Errno 61] Connection refused
+
+======================================================================
+ERROR: testCounts (test_storage.DBStorageTestCase)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 19, in setUp
+    self.classifier = self.StorageClass(self.db_name)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 154, in __init__
+    self.load()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 180, in load
+    self.dbm = dbmstorage.open(self.db_name, self.mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 70, in open
+    return f(db_name, mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 37, in open_best
+    funcs = [open_db3hash, open_dbhash, open_gdbm, open_db185hash]
+NameError: global name 'open_db185hash' is not defined
+
+======================================================================
+ERROR: testHapax (test_storage.DBStorageTestCase)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 19, in setUp
+    self.classifier = self.StorageClass(self.db_name)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 154, in __init__
+    self.load()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 180, in load
+    self.dbm = dbmstorage.open(self.db_name, self.mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 70, in open
+    return f(db_name, mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 37, in open_best
+    funcs = [open_db3hash, open_dbhash, open_gdbm, open_db185hash]
+NameError: global name 'open_db185hash' is not defined
+
+======================================================================
+ERROR: testLoadAndStore (test_storage.DBStorageTestCase)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 19, in setUp
+    self.classifier = self.StorageClass(self.db_name)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 154, in __init__
+    self.load()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 180, in load
+    self.dbm = dbmstorage.open(self.db_name, self.mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 70, in open
+    return f(db_name, mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 37, in open_best
+    funcs = [open_db3hash, open_dbhash, open_gdbm, open_db185hash]
+NameError: global name 'open_db185hash' is not defined
+
+======================================================================
+ERROR: testNoDBMAvailable (test_storage.DBStorageTestCase)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 19, in setUp
+    self.classifier = self.StorageClass(self.db_name)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 154, in __init__
+    self.load()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 180, in load
+    self.dbm = dbmstorage.open(self.db_name, self.mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 70, in open
+    return f(db_name, mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 37, in open_best
+    funcs = [open_db3hash, open_dbhash, open_gdbm, open_db185hash]
+NameError: global name 'open_db185hash' is not defined
+
+======================================================================
+ERROR: test_bug777026 (test_storage.DBStorageTestCase)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 19, in setUp
+    self.classifier = self.StorageClass(self.db_name)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 154, in __init__
+    self.load()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/storage.py", line 180, in load
+    self.dbm = dbmstorage.open(self.db_name, self.mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 70, in open
+    return f(db_name, mode)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/dbmstorage.py", line 37, in open_best
+    funcs = [open_db3hash, open_dbhash, open_gdbm, open_db185hash]
+NameError: global name 'open_db185hash' is not defined
+
+======================================================================
+FAIL: test_sb_server_default (test_programs.TestServer)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 160, in test_sb_server_default
+    self._start_spawner(s)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 142, in _start_spawner
+    spawner.start()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 97, in start
+    if self.is_running() and is_any_sb_server_running():
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 72, in is_running
+    "My server stopped, but global server mutex held")
+AssertionError: My server stopped, but global server mutex held
+
+======================================================================
+FAIL: test_sb_server_restore (test_programs.TestServer)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 174, in test_sb_server_restore
+    self._start_spawner(s)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 142, in _start_spawner
+    spawner.start()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 97, in start
+    if self.is_running() and is_any_sb_server_running():
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 72, in is_running
+    "My server stopped, but global server mutex held")
+AssertionError: My server stopped, but global server mutex held
+
+======================================================================
+FAIL: test_sb_server_ui_port (test_programs.TestServer)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 166, in test_sb_server_ui_port
+    self._start_spawner(s)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 142, in _start_spawner
+    spawner.start()
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 97, in start
+    if self.is_running() and is_any_sb_server_running():
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_programs.py", line 72, in is_running
+    "My server stopped, but global server mutex held")
+AssertionError: My server stopped, but global server mutex held
+
+======================================================================
+FAIL: test_extract_time_date (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 589, in test_extract_time_date
+    self.assertEqual(date, '"19-May-2004 20:05:15 +1200"')
+AssertionError: '"19-May-2004 20:05:15 -0500"' != '"19-May-2004 20:05:15 +1200"'
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: test_get_bad_message (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 640, in test_get_bad_message
+    self.msg.imap_server.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: test_get_full_message (test_sb_imapfilter.IMAPMessageTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 616, in test_get_full_message
+    self.msg.imap_server.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: testBadLogin (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 352, in testBadLogin
+    "wrong password")
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+You should see a message indicating that login failed.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: testConnection (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 343, in testConnection
+    self.assert_(self.imap.connected)
+AssertionError: 
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: testGoodLogin (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 346, in testGoodLogin
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: testSelectFolder (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 365, in testSelectFolder
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: test_folder_list (test_sb_imapfilter.IMAPSessionTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 386, in test_folder_list
+    self.imap.login(IMAP_USERNAME, IMAP_PASSWORD)
+  File "/Users/skip/local/lib/python2.7/site-packages/spambayes-1.1b1-py2.7.egg/EGG-INFO/scripts/sb_imapfilter.py", line 246, in login
+    assert self.connected, "Must be connected before logging in."
+AssertionError: Must be connected before logging in.
+-------------------- >> begin captured stdout << ---------------------
+Cannot connect to server localhost on port 143
+If you are connecting to an SSL server, please ensure that you have the 'Use SSL' option enabled.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: test_UI (test_sb_imapfilter.InterfaceTest)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_sb_imapfilter.py", line 829, in test_UI
+    response))
+AssertionError: 
+-------------------- >> begin captured stdout << ---------------------
+
+This test takes slightly over one second.
+
+--------------------- >> end captured stdout << ----------------------
+
+======================================================================
+FAIL: testHapax (test_storage.PickleStorageTestCase)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 91, in testHapax
+    self._dotestHapax(True)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 102, in _dotestHapax
+    do_persist)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 87, in _checkAllWordCounts
+    self._checkAllWordCounts(counts, False)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 83, in _checkAllWordCounts
+    self._checkWordCounts(*info)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 73, in _checkWordCounts
+    self.fail("_CheckWordCounts for '%s' got None!")
+AssertionError: _CheckWordCounts for '%s' got None!
+
+======================================================================
+FAIL: testLoadAndStore (test_storage.PickleStorageTestCase)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 42, in testLoadAndStore
+    ("ones", 1, 0)), False)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 83, in _checkAllWordCounts
+    self._checkWordCounts(*info)
+  File "/Users/skip/src/spambayes-svn/spambayes/spambayes/test/test_storage.py", line 73, in _checkWordCounts
+    self.fail("_CheckWordCounts for '%s' got None!")
+AssertionError: _CheckWordCounts for '%s' got None!
+
+----------------------------------------------------------------------
+Ran 61 tests in 18.063s
+
+FAILED (errors=45, failures=14)


Property changes on: trunk/spambayes/failing-unit-tests.txt
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Modified: trunk/spambayes/scripts/core_server.py
===================================================================
--- trunk/spambayes/scripts/core_server.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/scripts/core_server.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -41,16 +41,6 @@
 __author__ = "Richie Hindle <richie at entrian.com>"
 __credits__ = "Tim Peters, Neale Pickett, Tim Stone, all the Spambayes folk."
 
-try:
-    reversed
-except NameError:
-    # Maintain compatibility with Python 2.2 and 2.3
-    def reversed(seq):
-        """for backwards compatibility w/ pre-2.4"""
-        seq = list(seq[:])
-        seq.reverse()
-        return iter(seq)
-
 _TODO = """
 
 Protocol plugin interface:

Modified: trunk/spambayes/scripts/sb_dbexpimp.py
===================================================================
--- trunk/spambayes/scripts/sb_dbexpimp.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/scripts/sb_dbexpimp.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -77,22 +77,8 @@
 
 __author__ = "Tim Stone <tim at fourstonesExpressions.com>"
 
-try:
-    import csv
-    # might get the old object craft csv module - has no reader attr 
-    if not hasattr(csv, "reader"): 
-        raise ImportError 
-except ImportError:
-    import spambayes.compatcsv as csv
+import csv
 
-try:
-    x = UnicodeDecodeError
-except NameError:
-    UnicodeDecodeError = UnicodeError
-else:
-    del x
-
-
 import spambayes.storage
 from spambayes.Options import options
 import sys, os, getopt, errno

Modified: trunk/spambayes/scripts/sb_pop3dnd.py
===================================================================
--- trunk/spambayes/scripts/sb_pop3dnd.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/scripts/sb_pop3dnd.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -58,10 +58,6 @@
 import os
 import re
 import sys
-try:
-    from hashlib import md5
-except ImportError:
-    from md5 import new as md5
 import time
 import errno
 import email
@@ -71,10 +67,7 @@
 import imaplib
 import email.Utils
 
-try:
-    import cStringIO as StringIO
-except NameError:
-    import StringIO
+import cStringIO as StringIO
 
 from twisted import cred
 import twisted.application.app
@@ -95,6 +88,7 @@
 from spambayes import FileCorpus, Dibbler
 from spambayes.Version import get_current_version
 from sb_server import POP3ProxyBase, State, _addressPortStr
+from spambayes.port import md5
 
 def ensureDir(dirname):
     """Ensure that the given directory exists - in other words, if it

Modified: trunk/spambayes/scripts/sb_server.py
===================================================================
--- trunk/spambayes/scripts/sb_server.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/scripts/sb_server.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -48,15 +48,6 @@
 __author__ = "Richie Hindle <richie at entrian.com>"
 __credits__ = "Tim Peters, Neale Pickett, Tim Stone, all the Spambayes folk."
 
-try:
-    reversed
-except NameError:
-    # Maintain compatibility with Python 2.2 and 2.3
-    def reversed(seq):
-        seq = list(seq[:])
-        seq.reverse()
-        return iter(seq)
-
 todo = """
 
 Web training interface:

Modified: trunk/spambayes/spambayes/CoreUI.py
===================================================================
--- trunk/spambayes/spambayes/CoreUI.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/CoreUI.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -52,18 +52,6 @@
 import types
 import bisect
 
-try:
-    # We have three possibilities for Set:
-    #  (a) With Python 2.2 and earlier, we use our compatsets class
-    #  (b) With Python 2.3, we use the sets.Set class
-    #  (c) With Python 2.4 and later, we use the builtin set class
-    Set = set
-except NameError:
-    try:
-        from sets import Set
-    except ImportError:
-        from spambayes.compatsets import Set
-
 from spambayes import UserInterface
 from spambayes.Options import options, load_options, get_pathname_option, _
 ## no i18n yet...
@@ -325,7 +313,7 @@
         # that match those criteria.
         elif params.get('find') is not None:
             prior = next = 0
-            keys = Set()        # so we don't end up with duplicates
+            keys = set()        # so we don't end up with duplicates
             push = keys.add
             try:
                 max_results = int(params['max_results'])

Modified: trunk/spambayes/spambayes/Dibbler.py
===================================================================
--- trunk/spambayes/spambayes/Dibbler.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/Dibbler.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -173,10 +173,6 @@
 import socket, asyncore, asynchat, cgi, urlparse, webbrowser
 
 try:
-    from hashlib import md5
-except ImportError:
-    from md5 import new as md5
-try:
     "".rstrip("abc")
 except TypeError:
     # rstrip(chars) requires Python 2.2.2 or higher.  Apart from that
@@ -186,6 +182,8 @@
 else:
     RSTRIP_CHARS_AVAILABLE = True
 
+from spambayes.port import md5
+
 class BrighterAsyncChat(asynchat.async_chat):
     """An asynchat.async_chat that doesn't give spurious warnings on
     receiving an incoming connection, lets SystemExit cause an exit, can

Modified: trunk/spambayes/spambayes/ImageStripper.py
===================================================================
--- trunk/spambayes/spambayes/ImageStripper.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/ImageStripper.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -8,10 +8,6 @@
 import os
 import tempfile
 import math
-try:
-    from hashlib import md5
-except ImportError:
-    from md5 import new as md5
 import atexit
 try:
     import cStringIO as StringIO
@@ -24,6 +20,7 @@
     Image = None
 
 from spambayes.safepickle import pickle_read, pickle_write
+from spambayes.port import md5
 
 # The email mime object carrying the image data can have a special attribute
 # which indicates that a message had an image, but it was large (ie, larger
@@ -37,18 +34,6 @@
 # message body of a mime section.
 image_large_size_attribute = "spambayes_image_large_size"
 
-try:
-    # We have three possibilities for Set:
-    #  (a) With Python 2.2 and earlier, we use our compatsets class
-    #  (b) With Python 2.3, we use the sets.Set class
-    #  (c) With Python 2.4 and later, we use the builtin set class
-    Set = set
-except NameError:
-    try:
-        from sets import Set
-    except ImportError:
-        from spambayes.compatsets import Set
-
 from spambayes.Options import options
 
 # copied from tokenizer.py - maybe we should split it into pieces...
@@ -113,7 +98,7 @@
 
 def PIL_decode_parts(parts):
     """Decode and assemble a bunch of images using PIL."""
-    tokens = Set()
+    tokens = set()
     rows = []
     max_image_size = options["Tokenizer", "max_image_size"]
     for part in parts:
@@ -313,7 +298,7 @@
     def extract_ocr_info(self, pnmfiles):
         assert self.engine, "must have an engine!"
         textbits = []
-        tokens = Set()
+        tokens = set()
         for pnmfile in pnmfiles:
             preserve = False
             fhash = md5(open(pnmfile).read()).hexdigest()
@@ -367,15 +352,15 @@
             # We only get here if explicitly enabled - spewing msgs is ok.
             print >> sys.stderr, "invalid engine name '%s' - OCR disabled" \
                                  % (engine_name,)
-            return "", Set()
+            return "", set()
 
         if not parts:
-            return "", Set()
+            return "", set()
 
         if Image is not None:
             pnmfiles, tokens = PIL_decode_parts(parts)
         else:
-            return "", Set()
+            return "", set()
 
         if pnmfiles:
             text, new_tokens = self.extract_ocr_info(pnmfiles)

Modified: trunk/spambayes/spambayes/OptionsClass.py
===================================================================
--- trunk/spambayes/spambayes/OptionsClass.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/OptionsClass.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -88,21 +88,8 @@
 import re
 import types
 import locale
+from textwrap import wrap
 
-try:
-    import textwrap
-except ImportError:
-    # textwrap was added in 2.3
-    # We only use this for printing out errors and docstrings, so
-    # it doesn't need to be great (if you want it great, get a more
-    # recent Python!).  So we do it the dumb way; the textwrap code
-    # could be duplicated here if anyone cared.
-    def wrap(s):
-        length = 40
-        return [s[i:i+length].strip() for i in xrange(0, len(s), length)]
-else:
-    wrap = textwrap.wrap
-
 __all__ = ['OptionsClass',
            'HEADER_NAME', 'HEADER_VALUE',
            'INTEGER', 'REAL', 'BOOLEAN',

Modified: trunk/spambayes/spambayes/ProxyUI.py
===================================================================
--- trunk/spambayes/spambayes/ProxyUI.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/ProxyUI.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -52,18 +52,6 @@
 import types
 import bisect
 
-try:
-    # We have three possibilities for Set:
-    #  (a) With Python 2.2 and earlier, we use our compatsets class
-    #  (b) With Python 2.3, we use the sets.Set class
-    #  (c) With Python 2.4 and later, we use the builtin set class
-    Set = set
-except NameError:
-    try:
-        from sets import Set
-    except ImportError:
-        from spambayes.compatsets import Set
-
 from spambayes import UserInterface
 from spambayes.Options import options, _
 
@@ -340,7 +328,7 @@
         # that match those criteria.
         elif params.get('find') is not None:
             prior = next = 0
-            keys = Set()        # so we don't end up with duplicates
+            keys = set()        # so we don't end up with duplicates
             push = keys.add
             try:
                 max_results = int(params['max_results'])

Modified: trunk/spambayes/spambayes/PyMeldLite.py
===================================================================
--- trunk/spambayes/spambayes/PyMeldLite.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/PyMeldLite.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -195,13 +195,6 @@
 
 # Entrian.Coverage: Pragma Stop
 import sys, re, string
-try:
-    True, False, bool
-except NameError:
-    True = 1
-    False = 0
-    def bool(x):
-        return not not x
 # Entrian.Coverage: Pragma Start
 
 class _Fail:

Modified: trunk/spambayes/spambayes/TestDriver.py
===================================================================
--- trunk/spambayes/spambayes/TestDriver.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/TestDriver.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -21,18 +21,6 @@
 # # Display stats against all runs.
 # alldone()
 
-try:
-    # We have three possibilities for Set:
-    #  (a) With Python 2.2 and earlier, we use our compatsets class
-    #  (b) With Python 2.3, we use the sets.Set class
-    #  (c) With Python 2.4 and later, we use the builtin set class
-    Set = set
-except NameError:
-    try:
-        from sets import Set
-    except ImportError:
-        from spambayes.compatsets import Set
-
 from spambayes.Options import options
 from spambayes import Tester
 from spambayes import classifier
@@ -138,9 +126,9 @@
 class Driver:
 
     def __init__(self):
-        self.falsepos = Set()
-        self.falseneg = Set()
-        self.unsure = Set()
+        self.falsepos = set()
+        self.falseneg = set()
+        self.unsure = set()
         self.global_ham_hist = Hist()
         self.global_spam_hist = Hist()
         self.ntimes_finishtest_called = 0
@@ -269,7 +257,7 @@
                (t.nham_unsure + t.nspam_unsure) *
                options["TestDriver", "best_cutoff_unsure_weight"])
 
-        newfpos = Set(t.false_positives()) - self.falsepos
+        newfpos = set(t.false_positives()) - self.falsepos
         self.falsepos |= newfpos
         print "-> <stat> %d new false positives" % len(newfpos)
         if newfpos:
@@ -281,7 +269,7 @@
             prob, clues = c.spamprob(e, True)
             printmsg(e, prob, clues)
 
-        newfneg = Set(t.false_negatives()) - self.falseneg
+        newfneg = set(t.false_negatives()) - self.falseneg
         self.falseneg |= newfneg
         print "-> <stat> %d new false negatives" % len(newfneg)
         if newfneg:
@@ -293,7 +281,7 @@
             prob, clues = c.spamprob(e, True)
             printmsg(e, prob, clues)
 
-        newunsure = Set(t.unsures()) - self.unsure
+        newunsure = set(t.unsures()) - self.unsure
         self.unsure |= newunsure
         print "-> <stat> %d new unsure" % len(newunsure)
         if newunsure:

Modified: trunk/spambayes/spambayes/UserInterface.py
===================================================================
--- trunk/spambayes/spambayes/UserInterface.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/UserInterface.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -74,6 +74,7 @@
 import types
 import StringIO
 from email.Iterators import typed_subpart_iterator
+from textwrap import wrap
 
 from spambayes import oe_mailbox
 
@@ -1136,7 +1137,7 @@
             outer['From'] = from_addr
             v = Version.get_current_version()
             outer['X-Mailer'] = v.get_long_version(self.app_for_version)
-            outer.preamble = self._wrap(message)
+            outer.preamble = wrap(message)
             # To guarantee the message ends with a newline
             outer.epilogue = ''
 
@@ -1176,7 +1177,7 @@
                 msg.add_header('Content-Disposition', 'attachment',
                                filename=os.path.basename(attach))
                 outer.attach(msg)
-            msg = MIMEText(self._wrap(message))
+            msg = MIMEText(wrap(message))
             outer.attach(msg)
 
             recips = []
@@ -1202,24 +1203,6 @@
             return False
         return True
 
-    def _wrap(self, text, width=70):
-        """Wrap the text into lines no bigger than the specified width."""
-        try:
-            from textwrap import fill
-        except ImportError:
-            # No textwrap module, so do the same stuff (more-or-less)
-            # ourselves.
-            def fill(text, width):
-                if len(text) <= width:
-                    return text
-                wordsep_re = re.compile(r'(-*\w{2,}-(?=\w{2,})|' # hyphenated words
-                                        r'(?<=\S)-{2,}(?=\w))')  # em-dash
-                chunks = wordsep_re.split(text)
-                chunks = filter(None, chunks)
-            pass
-        return "\n".join([fill(paragraph, width) \
-                          for paragraph in text.split('\n')])
-
     def _wrap_chunks(self, chunks, width):
         """Stolen from textwrap; see that module in Python >= 2.3 for
         details."""

Modified: trunk/spambayes/spambayes/classifier.py
===================================================================
--- trunk/spambayes/spambayes/classifier.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/classifier.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -38,17 +38,6 @@
 # This implementation is due to Tim Peters et alia.
 
 import math
-try:
-    # We have three possibilities for Set:
-    #  (a) With Python 2.2 and earlier, we use our compatsets class
-    #  (b) With Python 2.3, we use the sets.Set class
-    #  (c) With Python 2.4 and later, we use the builtin set class
-    Set = set
-except NameError:
-    try:
-        from sets import Set
-    except ImportError:
-        from spambayes.compatsets import Set
 
 # XXX At time of writing, these are only necessary for the
 # XXX experimental url retrieving/slurping code.  If that
@@ -61,15 +50,6 @@
 import urllib2
 from email import message_from_string
 
-try:
-    enumerate
-except NameError:
-    def enumerate(seq):
-        i = 0
-        for elt in seq:
-            yield (i, elt)
-            i += 1
-
 DOMAIN_AND_PORT_RE = re.compile(r"([^:/\\]+)(:([\d]+))?")
 HTTP_ERROR_RE = re.compile(r"HTTP Error ([\d]+)")
 URL_KEY_RE = re.compile(r"[\W]")
@@ -370,7 +350,7 @@
         else:
             self.nham += 1
 
-        for word in Set(wordstream):
+        for word in set(wordstream):
             record = self._wordinfoget(word)
             if record is None:
                 record = self.WordInfoClass()
@@ -395,7 +375,7 @@
                 raise ValueError("non-spam count would go negative!")
             self.nham -= 1
 
-        for word in Set(wordstream):
+        for word in set(wordstream):
             record = self._wordinfoget(word)
             if record is not None:
                 if is_spam:
@@ -447,9 +427,9 @@
             push = raw.append
             pair = None
             # Keep track of which tokens we've already seen.
-            # Don't use a Set here!  This is an innermost loop, so speed is
+            # Don't use a set here!  This is an innermost loop, so speed is
             # important here (direct dict fiddling is much quicker than
-            # invoking Python-level Set methods; in Python 2.4 that will
+            # invoking Python-level set methods; in Python 2.4 that will
             # change).
             seen = {pair: 1} # so the bigram token is skipped on 1st loop trip
             for i, token in enumerate(wordstream):
@@ -484,11 +464,11 @@
             clues.reverse()
 
         else:
-            # The all-unigram scheme just scores the tokens as-is.  A Set()
+            # The all-unigram scheme just scores the tokens as-is.  A set()
             # is used to weed out duplicates at high speed.
             clues = []
             push = clues.append
-            for word in Set(wordstream):
+            for word in set(wordstream):
                 tup = self._worddistanceget(word)
                 if tup[0] >= mindist:
                     push(tup)

Modified: trunk/spambayes/spambayes/core_resources/__init__.py
===================================================================
--- trunk/spambayes/spambayes/core_resources/__init__.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/core_resources/__init__.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -4,32 +4,28 @@
 resource modules. You replace it with a blank or doc-only
 init when ready to release.
 """
-try:
-    __file__
-except NameError:
-    pass
-else:
-    import os
-    if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
-        try:
-            from resourcepackage import package, defaultgenerators
-            generators = defaultgenerators.generators.copy()
 
-            ### CUSTOMISATION POINT
-            ## import specialised generators here, such as for wxPython
-            #from resourcepackage import wxgenerators
-            #generators.update( wxgenerators.generators )
-        except ImportError:
-            pass
-        else:
-            package = package.Package(
-                    packageName = __name__,
-                    directory = os.path.dirname( os.path.abspath(__file__) ),
-                    generators = generators,
-            )
-            package.scan(
-                    ### CUSTOMISATION POINT
-                    ## force true -> always re-loads from external files, otherwise
-                    ## only reloads if the file is newer than the generated .py file.
-                    # force = 1,
-            )
+import os
+if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
+    try:
+        from resourcepackage import package, defaultgenerators
+        generators = defaultgenerators.generators.copy()
+
+        ### CUSTOMISATION POINT
+        ## import specialised generators here, such as for wxPython
+        #from resourcepackage import wxgenerators
+        #generators.update( wxgenerators.generators )
+    except ImportError:
+        pass
+    else:
+        package = package.Package(
+                packageName = __name__,
+                directory = os.path.dirname( os.path.abspath(__file__) ),
+                generators = generators,
+        )
+        package.scan(
+                ### CUSTOMISATION POINT
+                ## force true -> always re-loads from external files, otherwise
+                ## only reloads if the file is newer than the generated .py file.
+                # force = 1,
+        )

Modified: trunk/spambayes/spambayes/core_resources/scanning__init__.py
===================================================================
--- trunk/spambayes/spambayes/core_resources/scanning__init__.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/core_resources/scanning__init__.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -10,37 +10,33 @@
 resource modules. You replace it with a blank or doc-only
 init when ready to release.
 """
-try:
-    __file__
-except NameError:
-    pass
-else:
-    import os
-    if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
-        try:
-            from resourcepackage import package, defaultgenerators
-            generators = defaultgenerators.generators.copy()
 
-            ### CUSTOMISATION POINT
-            ## import specialised generators here, such as for wxPython
-            #from resourcepackage import wxgenerators
-            #generators.update( wxgenerators.generators )
-        except ImportError:
-            pass
-        else:
-            package = package.Package(
-                    packageName = __name__,
-                    directory = os.path.dirname( os.path.abspath(__file__) ),
-                    generators = generators,
-            )
-            package.scan(
-                    ### CUSTOMISATION POINT
-                    ## force true -> always re-loads from external files, otherwise
-                    ## only reloads if the file is newer than the generated .py file.
-                    # force = 1,
-            )
+import os
+if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
+    try:
+        from resourcepackage import package, defaultgenerators
+        generators = defaultgenerators.generators.copy()
 
+        ### CUSTOMISATION POINT
+        ## import specialised generators here, such as for wxPython
+        #from resourcepackage import wxgenerators
+        #generators.update( wxgenerators.generators )
+    except ImportError:
+        pass
+    else:
+        package = package.Package(
+                packageName = __name__,
+                directory = os.path.dirname( os.path.abspath(__file__) ),
+                generators = generators,
+        )
+        package.scan(
+                ### CUSTOMISATION POINT
+                ## force true -> always re-loads from external files, otherwise
+                ## only reloads if the file is newer than the generated .py file.
+                # force = 1,
+        )
 
+
 # ResourcePackage license added by Richie Hindle <richie at entrian.com>,
 # since this is "Redistribution and use in source form".  Note that binary
 # Spambayes packages don't redistribute this file or rely on ResourcePackage;

Modified: trunk/spambayes/spambayes/dbmstorage.py
===================================================================
--- trunk/spambayes/spambayes/dbmstorage.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/dbmstorage.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -16,22 +16,15 @@
 def open_dbhash(*args):
     """Open a bsddb hash.  Don't use this on Windows, unless Python 2.3 or
     greater is used, in which case bsddb3 is actually named bsddb."""
-    try:
-        import bsddb
-    except ImportError:
-        import bsddb3 as bsddb
+    from spambayes.port import bsddb
     return bsddb.hashopen(*args)
 
-def open_db185hash(*args):
-    """Open a bsddb185 hash."""
-    # See [ 1106457 ] bsddb185 has to be covered in dbmstorage.py
-    import bsddb185
-    return bsddb185.hashopen(*args)
-
 def open_gdbm(*args):
     """Open a gdbm database."""
-    import gdbm
-    return gdbm.open(*args)
+    from spambayes.port import gdbm
+    if gdbm is not None:
+        return gdbm.open(*args)
+    raise ImportError("gdbm not available")
 
 def open_best(*args):
     if sys.platform == "win32":
@@ -53,7 +46,6 @@
     "best": open_best,
     "db3hash": open_db3hash,
     "dbhash": open_dbhash,
-    "bsddb185": open_db185hash,
     "gdbm": open_gdbm,
     }
 

Modified: trunk/spambayes/spambayes/i18n.py
===================================================================
--- trunk/spambayes/spambayes/i18n.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/i18n.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -84,10 +84,7 @@
     LANG_DIR = os.path.join(os.path.dirname(__file__), "languages")
 
 else:
-    try:
-        this_filename = os.path.abspath(__file__)
-    except NameError: # no __file__ - means Py2.2 and __name__=='__main__'
-        this_filename = os.path.abspath(sys.argv[0])
+    this_filename = os.path.abspath(__file__)
     LANG_DIR = os.path.join(os.path.dirname(this_filename), "languages")
     LC_DIR = LANG_DIR
 

Modified: trunk/spambayes/spambayes/languages/de/__init__.py
===================================================================
--- trunk/spambayes/spambayes/languages/de/__init__.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/languages/de/__init__.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -4,32 +4,28 @@
 resource modules. You replace it with a blank or doc-only
 init when ready to release.
 """
-try:
-    __file__
-except NameError:
-    pass
-else:
-    import os
-    if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
-        try:
-            from resourcepackage import package, defaultgenerators
-            generators = defaultgenerators.generators.copy()
 
-            ### CUSTOMISATION POINT
-            ## import specialised generators here, such as for wxPython
-            #from resourcepackage import wxgenerators
-            #generators.update( wxgenerators.generators )
-        except ImportError:
-            pass
-        else:
-            package = package.Package(
-                    packageName = __name__,
-                    directory = os.path.dirname( os.path.abspath(__file__) ),
-                    generators = generators,
-            )
-            package.scan(
-                    ### CUSTOMISATION POINT
-                    ## force true -> always re-loads from external files, otherwise
-                    ## only reloads if the file is newer than the generated .py file.
-                    # force = 1,
-            )
+import os
+if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
+    try:
+        from resourcepackage import package, defaultgenerators
+        generators = defaultgenerators.generators.copy()
+
+        ### CUSTOMISATION POINT
+        ## import specialised generators here, such as for wxPython
+        #from resourcepackage import wxgenerators
+        #generators.update( wxgenerators.generators )
+    except ImportError:
+        pass
+    else:
+        package = package.Package(
+                packageName = __name__,
+                directory = os.path.dirname( os.path.abspath(__file__) ),
+                generators = generators,
+        )
+        package.scan(
+                ### CUSTOMISATION POINT
+                ## force true -> always re-loads from external files, otherwise
+                ## only reloads if the file is newer than the generated .py file.
+                # force = 1,
+        )

Modified: trunk/spambayes/spambayes/languages/es/__init__.py
===================================================================
--- trunk/spambayes/spambayes/languages/es/__init__.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/languages/es/__init__.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -4,32 +4,28 @@
 resource modules. You replace it with a blank or doc-only
 init when ready to release.
 """
-try:
-    __file__
-except NameError:
-    pass
-else:
-    import os
-    if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
-        try:
-            from resourcepackage import package, defaultgenerators
-            generators = defaultgenerators.generators.copy()
 
-            ### CUSTOMISATION POINT
-            ## import specialised generators here, such as for wxPython
-            #from resourcepackage import wxgenerators
-            #generators.update( wxgenerators.generators )
-        except ImportError:
-            pass
-        else:
-            package = package.Package(
-                    packageName = __name__,
-                    directory = os.path.dirname( os.path.abspath(__file__) ),
-                    generators = generators,
-            )
-            package.scan(
-                    ### CUSTOMISATION POINT
-                    ## force true -> always re-loads from external files, otherwise
-                    ## only reloads if the file is newer than the generated .py file.
-                    # force = 1,
-            )
+import os
+if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
+    try:
+        from resourcepackage import package, defaultgenerators
+        generators = defaultgenerators.generators.copy()
+
+        ### CUSTOMISATION POINT
+        ## import specialised generators here, such as for wxPython
+        #from resourcepackage import wxgenerators
+        #generators.update( wxgenerators.generators )
+    except ImportError:
+        pass
+    else:
+        package = package.Package(
+                packageName = __name__,
+                directory = os.path.dirname( os.path.abspath(__file__) ),
+                generators = generators,
+        )
+        package.scan(
+                ### CUSTOMISATION POINT
+                ## force true -> always re-loads from external files, otherwise
+                ## only reloads if the file is newer than the generated .py file.
+                # force = 1,
+        )

Modified: trunk/spambayes/spambayes/languages/es_AR/__init__.py
===================================================================
--- trunk/spambayes/spambayes/languages/es_AR/__init__.py	2009-01-27 11:04:58 UTC (rev 3229)
+++ trunk/spambayes/spambayes/languages/es_AR/__init__.py	2009-01-27 11:25:19 UTC (rev 3230)
@@ -4,32 +4,28 @@
 resource modules. You replace it with a blank or doc-only
 init when ready to release.
 """
-try:
-    __file__
-except NameError:
-    pass
-else:
-    import os
-    if os.path.splitext(os.path.basename( __file__ ))[0] == "__init__":
-        try:
-            from resourcepackage import package, defaultgenerators
-            generators = defaultgenerators.generators.copy()
 
-            ### CUSTOMISATION POINT
-            ## import specialised generators here, such as for wxPython
-            #from resourcepackage import wxgenerators
-            #generators.update( wxgenerators.generators )
-        except ImportError:
-            pass
-        else:
-            package = package.Package(

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the Spambayes-checkins mailing list