husio / python-sqlite3-backup

Sqlite3 online API CPython implementation module
http://pypi.python.org/pypi/sqlitebck/
42 stars 9 forks source link

Use sqlite3_get_autocommit() instead of Connection->inTransaction #9

Closed cedk closed 7 years ago

cedk commented 7 years ago

In Python 3.6, inTransaction has been replaced by a getter which uses sqlite3_get_autocommit. See https://hg.python.org/cpython/rev/80946f95e88a

husio commented 7 years ago

:+1:

I understand this is not available for any version older than 3.6. Can you add macro (similar to what is already used), so that this function is used only in python 3.6 and higher? Otherwise this library will stop working for older versions.

cedk commented 7 years ago

I tested on old version and it worked. The method 'sqlite3_get_autocommit' is part of sqlite and does the same as what was manually managed in older Python with inTransaction

cedk commented 7 years ago

@husio Thanks for merging it. Do you plan to make a release soon because this bug breaks our CI. So if you do one, I will not have to push our quick fix from https://bugs.tryton.org/issue6873

husio commented 7 years ago

You mean push it to PYPI? I can do this in few hours.

cedk commented 7 years ago

Yes, that's will be great.

husio commented 7 years ago

Done.