piskvorky/sqlitedict

sqlite3.DatabaseError: database disk image is malformed

Opened this issue · 0 comments

After power down I got this issue on many files.
Other sqlite3 files were working well.

class nestedDictSqlite(defaultdict):
    'like defaultdict but default_factory receives the key so table is used to form first argument'

    def __missing__(self, table):
        self[table] = value = self.default_factory(table)
        return value

InstaPyLimits.limiter_db = nestedDictSqlite(
            lambda table: SqliteDict(filename='{}{}_limiter.db'.format(Settings.limiter_database_location, user_id),
                                     tablename=table, flag='c', autocommit=True, encode=json.dumps, decode=json.loads))

image

What can it be ?