Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite3.DatabaseError: database disk image is malformed #149

Open
instasck opened this issue Apr 7, 2022 · 0 comments
Open

sqlite3.DatabaseError: database disk image is malformed #149

instasck opened this issue Apr 7, 2022 · 0 comments

Comments

@instasck
Copy link

instasck commented Apr 7, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant