Created
April 20, 2012 13:19
-
-
Save simahawk/2428496 to your computer and use it in GitHub Desktop.
temporary fix for ZODB connection KeyError
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# temporary hack for fixing ZODB connection error | |
from ZODB import FileStorage, DB | |
dbname = 'my_missing_db' | |
path = 'path/to/missing/storage.fs' | |
storage = FileStorage.FileStorage(path) | |
db = DB(storage) | |
# app is the zope instance in debug mode | |
app._p_jar._db.databases[dbname] = db | |
# as a temp hack you can use this into ZODB.Connection.get_connection method | |
# (just replace 'app._p_jar' with 'self') | |
##### DO THIS AT YOUR OWN RISK! ##### | |
##### DO THIS WITH A BACKUP! ##### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment