diff --git a/trytond/trytond/backend/sqlite/database.py b/trytond/trytond/backend/sqlite/database.py index dc4863cd55..49a9723879 100644 --- a/trytond/trytond/backend/sqlite/database.py +++ b/trytond/trytond/backend/sqlite/database.py @@ -596,8 +596,14 @@ class Database(DatabaseInterface): return if os.sep in database_name: return - os.remove(os.path.join(config.get('database', 'path'), - database_name + '.sqlite')) + file = os.path.join( + config.get('database', 'path'), database_name + '.sqlite') + os.remove(file) + for suffix in ['-shm', '-wal']: + try: + os.remove(file + suffix) + except FileNotFoundError: + pass def list(self, hostname=None): res = []