[Spambayes] hammie's dbm file has changed

Tim Peters tim.one@comcast.net
Mon Nov 18 06:12:19 2002


[Ranieri J D Severiano <rjdsnet@yahoo.com>]
> ranieri@uyrapuru:spambayes$ ./hammie.py -s ~/Mail/bulkmail
> Traceback (most recent call last):
>   File "./hammie.py", line 497, in ?
>     main()
>   File "./hammie.py", line 459, in main
>     bayes = createbayes(pck, usedb, mode)
>   File "./hammie.py", line 401, in createbayes
>     bayes = pickle.load(fp)
>   File "/usr/lib/python2.2/copy_reg.py", line 40, in _reconstructor
>     obj = base.__new__(cls, state)
> TypeError: ('object.__new__(X): X is not a type object
>   (class)', <function _reconstructor at 0x8148cd4>, (<class
>   classifier.Bayes at 0x82103b4>, <type 'object'>, None))

This is what happens if you try to load a Bayes pickle created before
classifier.Bayes changed from a new-style class to an old-style class.
You're best off retraining from scratch.  If you're desperate to retrieve
the old data, you can change

class Bayes:

back to

class Bayes(object):

and the pickle should load again.




More information about the Spambayes mailing list