[spambayes-dev] A new and altogether different bsddb breakage

Kenny Pitt kennypitt at hotmail.com
Mon Dec 15 11:27:46 EST 2003


Tim Peters wrote:
> [Richie Hindle]
>> I think we're using different versions of bsddb - your code fails
>> for me: 
>> 
>> >>> d = bsddb.hashopen("/src/tests/spambayes/hammie.db")
>> >>> len(d)
>> 52331
>> >>> len([k for k in d if d.get(k, None) is None])
>> Traceback (most recent call last):
>>   File "<pyshell#4>", line 1, in -toplevel-
>>     len([k for k in d if d.get(k, None) is None])
>>   File "C:\Python23\lib\bsddb\__init__.py", line 86, in __getitem__ 
>>     return self.db[key]
>> TypeError: Integer keys only allowed for Recno and Queue DB's 
> 
> Not here:
> 
> >>> PATH = "/WINDOWS/Application
Data/SpamBayes/default_bayes_database.db"
> >>> import bsddb
> >>> d = bsddb.hashopen(PATH, 'r') 
> >>> len([k for k in d.keys() if d.get(k, None) is None])
> 0
> >>> 
> 
>> I have Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit
>> (Intel)] on win32.  Assuming that's a red herring,
> 
> I wouldn't assume that -- it may be the whole ball of wax.  I'm using
> exactly the same, *except* I'm using 2.3.3c1 (also on Windows), and a
> number of bsddb3 fixes have been checked in since Python 2.3.  It
> would help if you tried 2.3.3c1.  If your symptoms above persist,
> then we've got a Major Mystery to sort out (e.g., maybe you-- or I
> --aren't getting the version of bsddb the Windows installer intended
> us to get). 

I get the same results as Tim using the 2.3.2 final version: Python
2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32

In my 2.3.2 lib, the "return self.db[key]" line in __getitem__ is on
line 116 of __init__.py, not line 86 as in Richie's traceback.  I could
expect some changes between Python 2.3 and 2.3.2, but 30 lines seems a
bit much between minor bugfix releases.  Is that possibly an indicator
of a bsddb version mismatch?

-- 
Kenny Pitt




More information about the spambayes-dev mailing list