bsddb throws a TypeError when I try to use an unicode string as key name; i.e. bsddb.btopen("foobar", "c")[u'foo'] = "bar" fails I discovered it while experimenting with the shelve module. You may find more information in the attached file. Python version: 2.5.1 OS: Windows XP SP2 (5.1.2600)
The BerkeleyDB library operates on bytes only. Unicode doesn't make sense as a key without converting it to a particular encoding first. Use the unicode object's encode() method if you need to use it as a database key or create a wrapper object or subclass of the db that automatically does that for you as appropriate.