[pypy-commit] pypy stdlib-2.7.13: Revert the change to sqlite that occurred in 2.7.13, and document it as
arigo
pypy.commits at gmail.com
Sun Dec 18 16:29:24 EST 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: stdlib-2.7.13
Changeset: r89167:23c8b64a1b80
Date: 2016-12-18 22:28 +0100
http://bitbucket.org/pypy/pypy/changeset/23c8b64a1b80/
Log: Revert the change to sqlite that occurred in 2.7.13, and document it
as a known difference with CPython 2.7.13.
diff --git a/lib-python/2.7/sqlite3/test/regression.py b/lib-python/2.7/sqlite3/test/regression.py
--- a/lib-python/2.7/sqlite3/test/regression.py
+++ b/lib-python/2.7/sqlite3/test/regression.py
@@ -24,6 +24,7 @@
import datetime
import unittest
import sqlite3 as sqlite
+from test import test_support
class RegressionTests(unittest.TestCase):
def setUp(self):
@@ -350,7 +351,10 @@
self.assertRaises(ValueError, cur.execute, " \0select 2")
self.assertRaises(ValueError, cur.execute, "select 2\0")
+ @test_support.impl_detail(pypy=False)
def CheckCommitCursorReset(self):
+ # This test is for logic added in 2.7.13 which PyPy doesn't
+ # implement. See http://bugs.python.org/issue29006
"""
Connection.commit() did reset cursors, which made sqlite3
to return rows multiple times when fetched from cursors
diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -418,8 +418,15 @@
if not self._in_transaction:
return
- # the following line is removed for compatibility with 2.7.13:
- # self.__do_all_statements(Statement._reset, False)
+ # The following line is a KNOWN DIFFERENCE with CPython 2.7.13.
+ # More precisely, the corresponding line was removed in the
+ # version 2.7.13 of CPython, but this is causing troubles for
+ # PyPy (and potentially for CPython too):
+ #
+ # http://bugs.python.org/issue29006
+ #
+ # So for now, we keep this line.
+ self.__do_all_statements(Statement._reset, False)
statement_star = _ffi.new('sqlite3_stmt **')
ret = _lib.sqlite3_prepare_v2(self._db, b"COMMIT", -1,
diff --git a/pypy/doc/cpython_differences.rst b/pypy/doc/cpython_differences.rst
--- a/pypy/doc/cpython_differences.rst
+++ b/pypy/doc/cpython_differences.rst
@@ -488,6 +488,11 @@
the rest is kept. If you return an unexpected string from
``__hex__()`` you get an exception (or a crash before CPython 2.7.13).
+* The ``sqlite`` module was updated on 2.7.13 to no longer reset all
+ cursors when there is a commit. This causes troubles for PyPy (and
+ potentially for CPython too), and so for now we didn't port this change:
+ see http://bugs.python.org/issue29006.
+
.. _`is ignored in PyPy`: http://bugs.python.org/issue14621
.. _`little point`: http://events.ccc.de/congress/2012/Fahrplan/events/5152.en.html
.. _`#2072`: https://bitbucket.org/pypy/pypy/issue/2072/
More information about the pypy-commit
mailing list