FS#25058 - [python2]: removal of bsddb support broke existing shelve databases

Attached to Project: Arch Linux
Opened by Ayla Ounce (reacocard) - Thursday, 07 July 2011, 21:02 GMT
Last edited by Stéphane Gaudreault (stephane) - Thursday, 14 July 2011, 11:04 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Stéphane Gaudreault (stephane)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The music player I use and develop for, Exaile, uses python's shelve module for persistence. By default, shelve uses the bsddb support if it is available, so when this support was disabled a few days ago, shelve became incapable of opening any existing databases, even if python2-bsddb is installed. Even yet more worrisome, shelve appears to now be incapable of starting a new database (via shelve.open(filename, 'c')), so its not even possible to create a new DB.

Please reenable bsddb support so that Exaile (and anything else using shelve) will be useable on arch linux.
This task depends upon

Closed by  Stéphane Gaudreault (stephane)
Thursday, 14 July 2011, 11:04 GMT
Reason for closing:  Won't fix
Comment by Ionut Biru (wonder) - Thursday, 07 July 2011, 21:13 GMT
see  FS#25045 

Comment by Ayla Ounce (reacocard) - Thursday, 07 July 2011, 21:43 GMT
The problem is that shelve _doesn't_ work with that module, at least not so far as I can tell, and moreover the shelve module as a whole seems largely broken by this change, because the missing bsddb module confuses anydbm.open. That part might be an upstream bug though, if its intended to be possible to disable the bsddb support.
Comment by Ayla Ounce (reacocard) - Thursday, 07 July 2011, 22:08 GMT
Alright, while shelve doesn't work with it automatically, you can get it to work by doing something like this in your code:

import shelve
try:
data = shelve.open(location)
except ImportError:
import bsddb3
_db = bsddb3.hashopen(self.location)
data = shelve.Shelf(_db)

Rather awkward, but it works.
Comment by robert r (crobe) - Saturday, 09 July 2011, 10:28 GMT
Ack, the problem I also see, is that after installing python2-bsddb the module is named bsddb3 instead of bsddb.
Comment by robert r (crobe) - Saturday, 09 July 2011, 14:56 GMT
And btw, downgrading libdb gives problems with at least LibreOffice.
Comment by Stéphane Gaudreault (stephane) - Thursday, 14 July 2011, 11:03 GMT
As bsddb is deprecated since python version 2.6 and is now maintained as a third party package. I suggest to ask upstream (Exaile devs ?) for better support of the bsddb3 module.

Loading...