From b5c0c4623bc865cdb8094abb533b227a1372678c Mon Sep 17 00:00:00 2001 From: Matthew Perry Date: Tue, 2 May 2017 09:14:56 -0600 Subject: [PATCH] gaurd against sqlite transaction bug in py36 --- .travis.yml | 1 + mbutil/util.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2bb6d6a..b89ac9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: python python: - 2.6 - 2.7 + - 3.6 install: - pip install nose script: diff --git a/mbutil/util.py b/mbutil/util.py index 3e82b76..46bf603 100755 --- a/mbutil/util.py +++ b/mbutil/util.py @@ -71,7 +71,13 @@ def optimize_database(cur, silent): cur.execute("""ANALYZE;""") if not silent: logger.debug('cleaning db') + + # Workaround for python>=3.6.0,python<3.6.2 + # https://bugs.python.org/issue28518 + cur.isolation_level = None cur.execute("""VACUUM;""") + cur.isolation_level = '' # reset default value of isolation_level + def compression_do(cur, con, chunk, silent): if not silent: