[Spambayes] *nix error after upgrade
Atom 'Smasher'
atom at suspicious.org
Mon Nov 24 12:53:11 EST 2003
ok, using the new python (the one giving me a problem) this first test
seems to have passed:
$ python
Python 2.3.2 (#1, Nov 24 2003, 00:10:59)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import shelve
>>> db = shelve.open(".hammiedb")
>>> len(db)
1
>>> db.close()
>>>
the second test didn't:
$ python
Python 2.3.2 (#1, Nov 24 2003, 00:10:59)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> from spambayes.storage import open_storage
>>> s = open_storage(".hammiedb")
>>> s
>>> dir(s)
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
'__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__str__']
>>> s._wordinfoget("python")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'NoneType' object has no attribute '_wordinfoget'
>>>
now what??
thanks....
On Mon, 24 Nov 2003, Skip Montanaro wrote:
>
> atom> File "/usr/local/lib/python2.3/site-packages/spambayes/hammie.py", line 247, in store
> atom> self.bayes.store()
> atom> AttributeError: 'NoneType' object has no attribute 'store'
>
> and
>
> atom> File "/usr/local/lib/python2.3/site-packages/spambayes/hammie.py", line 38, in _scoremsg
> atom> return self.bayes.spamprob(tokenize(msg), evidence)
> atom> AttributeError: 'NoneType' object has no attribute 'spamprob'
>
> Both suggest that opening a database file failed. Somewhere you have a
> database file, right? Suppose it's named hammie.db. Try this:
>
> % python
> Python 2.4a0 (#5, Nov 23 2003, 20:09:38)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1493)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import shelve
> >>> db = shelve.open("hammie.db")
> >>> len(db)
> 40569
> >>> db.close()
>
> Does that succeed for Python 2.2 but fail for 2.3? If so, I'd suspect a
> file version change. If not, continue on to step two.
>
> % python
> Python 2.4a0 (#5, Nov 23 2003, 20:09:38)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1493)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from spambayes.storage import open_storage
> >>> s = open_storage("hammie.db")
> >>> s
> <spambayes.storage.DBDictClassifier instance at 0x764968>
> >>> dir(s)
> ['WordInfoClass', '__doc__', '__getstate__', '__init__', '__module__', '__setstate__', '_add_msg', '_getclues', '_post_training', '_remove_msg', '_wordinfodel', '_wordinfoget', '_wordinfokeys', '_wordinfoset', '_write_state_key', 'changed_words', 'chi2_spamprob', 'close', 'db', 'db_name', 'dbm', 'learn', 'load', 'mode', 'nham', 'nspam', 'probability', 'probcache', 'spamprob', 'statekey', 'store', 'unlearn', 'wordinfo']
> >>> s._wordinfoget("python")
> WordInfo(2, 14)
>
> Does this succeed for one version of Python but not the other?
>
> I suspect you have some sort of version-related problems, but they are
> related to the FreeBSD environment, not directly to Python's versioning.
>
> Skip
>
...atom
_______________________________________________
PGP key - http://smasher.suspicious.org/pgp.txt
3EBE 2810 30AE 601D 54B2 4A90 9C28 0BBF 3D7D 41E3
-------------------------------------------------
"The real truth of the matter is, as you and I know, that a
financial element in the large centers has owned the
government of the U.S. since the days of Andrew Jackson."
-- Franklin Delano Roosevelt, November 21st, l933
More information about the Spambayes
mailing list