This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sqlite3: can't run VACUUM on Python 3.6
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: execute("begin immediate") throwing OperationalError
View: 28518
Assigned To: Nosy List: berker.peksag, ghaering, malin
Priority: normal Keywords: 3.6regression

Created on 2016-12-18 03:19 by malin, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cannot_vacuum.py malin, 2016-12-18 03:19
Messages (2)
msg283532 - (view) Author: Ma Lin (malin) * Date: 2016-12-18 03:19
I'm using Python 3.6.0 RC2.
When I try to run VACUUM command, an exception raised:

conn.execute('begin')  # <- remove this line get the same result
conn.execute('VACUUM')

sqlite3.OperationalError: cannot VACUUM from within a transaction

On Python 3.5, everything is fine.
Attached file cant_vacuum.py is the full example code.

----------
related issue: #10740 sqlite3 module breaks transactions and potentially corrupts data

R. David Murray said in #10740 about this issue:
It is an unexpected change in behavior and is therefore probably a bug.  It will work if you set isolation_level=None.  Because of that I don't think it is a release critical bug, though one could wish we'd discovered it earlier.
msg284270 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-12-29 15:07
Thanks for trying pre-release versions of Python 3.6, Ma Lin. This has already been reported in issue 28518 so I'm closing this as a duplicate.
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73189
2016-12-29 15:07:17berker.peksagsetstatus: open -> closed
superseder: execute("begin immediate") throwing OperationalError
messages: + msg284270

resolution: duplicate
stage: resolved
2016-12-18 03:39:55ned.deilysetkeywords: + 3.6regression
nosy: + ghaering, berker.peksag
2016-12-18 03:19:32malincreate