[spambayes-dev] [ spambayes-Bugs-761670 ] Unexpected unicode key in
bsd db
SourceForge.net
noreply at sourceforge.net
Mon Jun 30 19:15:04 EDT 2003
Bugs item #761670, was opened at 2003-06-27 01:01
Message generated for change (Comment added) made by cst
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=761670&group_id=61702
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Christian Stork (cst)
Assigned to: Nobody/Anonymous (nobody)
Summary: Unexpected unicode key in bsd db
Initial Comment:
On Debian (unstable) with python 2.3b1:
cst at comuter% pdb mboxtrain.py -n -d ~/.hammiedb -g ~/
Mail.d/Box -g ~/Mail.d/roeinst -g ~/Mail.d/friends -g ~/
Mail.d/freunde -g ~/Mail.d/deadmonkey-list -s ~/Mail.d/
spam
Training ham (/home/chs/Mail.d/Box):
Reading as Maildir
Trained 0 out of 40 messages
Training ham (/home/chs/Mail.d/roeinst):
Reading as Maildir
Trained 0 out of 2902 messages
Training ham (/home/chs/Mail.d/friends):
Reading as Maildir
Trained 2 out of 3690 messages
Training ham (/home/chs/Mail.d/freunde):
Reading as Maildir
Traceback (most recent call last):
File "/home/chs/bin/pdb", line 43, in ?
execfile(script)
File "mboxtrain.py", line 294, in ?
main()
File "mboxtrain.py", line 281, in main
train(h, g, False, force, trainnew)
File "mboxtrain.py", line 216, in train
maildir_train(h, os.path.join(path, "cur"), is_spam, force)
File "mboxtrain.py", line 110, in maildir_train
if not msg_train(h, msg, is_spam, force):
File "mboxtrain.py", line 80, in msg_train
h.train(msg, is_spam)
File "/home/chs/src/spambayes/spambayes/hammie.py",
line 150, in train
self.bayes.learn(tokenize(msg), is_spam)
File "/home/chs/src/spambayes/spambayes/classifier.py",
line 276, in learn
self._add_msg(wordstream, is_spam)
File "/home/chs/src/spambayes/spambayes/classifier.py",
line 402, in _add_msg
record = self._wordinfoget(word)
File "/home/chs/src/spambayes/spambayes/storage.py",
line 215, in _wordinfoget
r = self.db.get(word)
File "/usr/lib/python2.3/shelve.py", line 110, in get
if self.dict.has_key(key):
File "/usr/lib/python2.3/bsddb/__init__.py", line 112, in
has_key
return self.db.has_key(key)
TypeError: String or Integer object expected for key,
unicode found
> /usr/lib/python2.3/bsddb/__init__.py(112)has_key()
-> return self.db.has_key(key)
(Pdb) p key
u'filename:fname piece:Huettenfete01-
Wegbeschreibung_H\xfctte'
----------------------------------------------------------------------
>Comment By: Christian Stork (cst)
Date: 2003-06-30 18:15
Message:
Logged In: YES
user_id=23468
Works fine with Skip's patch. Thanks, Chris.
----------------------------------------------------------------------
Comment By: Skip Montanaro (montanaro)
Date: 2003-06-30 13:31
Message:
Logged In: YES
user_id=44345
Can you try out the attached patch and let us know how it works?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=761670&group_id=61702
More information about the spambayes-dev
mailing list