Hello community, here is the log from the commit of package python-BTrees for openSUSE:Factory checked in at 2020-04-15 19:53:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-BTrees (Old) and /work/SRC/openSUSE:Factory/.python-BTrees.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-BTrees" Wed Apr 15 19:53:24 2020 rev:11 rq:793790 version:4.7.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-BTrees/python-BTrees.changes 2020-03-27 00:29:39.620389405 +0100 +++ /work/SRC/openSUSE:Factory/.python-BTrees.new.2738/python-BTrees.changes 2020-04-15 19:53:25.853570207 +0200 @@ -1,0 +2,7 @@ +Tue Apr 14 09:19:56 UTC 2020 - Tomáš Chvátal <tchva...@suse.com> + +- Do not bother with documentation +- Update to 4.7.2: + * Fix more cases of C and Python inconsistency. + +------------------------------------------------------------------- Old: ---- BTrees-4.7.1.tar.gz New: ---- BTrees-4.7.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-BTrees.spec ++++++ --- /var/tmp/diff_new_pack.gC6nPc/_old 2020-04-15 19:53:26.377570443 +0200 +++ /var/tmp/diff_new_pack.gC6nPc/_new 2020-04-15 19:53:26.381570445 +0200 @@ -19,19 +19,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-BTrees -Version: 4.7.1 +Version: 4.7.2 Release: 0 Summary: Persistent B-tree object containers for Python License: ZPL-2.1 -URL: http://www.zope.org/Products/ZODB +URL: https://github.com/zopefoundation/BTrees Source: https://files.pythonhosted.org/packages/source/B/BTrees/BTrees-%{version}.tar.gz -# Documentation requirements: -BuildRequires: %{python_module Sphinx} BuildRequires: %{python_module devel} BuildRequires: %{python_module persistent-devel >= 4.1.0} -BuildRequires: %{python_module repoze.sphinx.autointerface} BuildRequires: %{python_module setuptools} -# Testing requirements: BuildRequires: %{python_module transaction} BuildRequires: %{python_module zope.interface} BuildRequires: %{python_module zope.testrunner} @@ -39,6 +35,7 @@ BuildRequires: python-rpm-macros Requires: python-persistent >= 4.1.0 Requires: python-zope.interface +Obsoletes: %{name}-doc %python_subpackages %description @@ -58,21 +55,12 @@ %description devel This package contains the files needed for binding the %{name} C module. -%package doc -Summary: Documentation for the python-BTrees module -Requires: %{name} = %{version} - -%description doc -This package contains documentation files for %{name}. - %prep %setup -q -n BTrees-%{version} rm -rf BTrees.egg-info %build %python_build -%{_python_use_flavor python3} -python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo %install %python_install @@ -92,7 +80,4 @@ %files %{python_files devel} %{python_sitearch}/BTrees/*.h -%files %{python_files doc} -%doc build/sphinx/html/ - %changelog ++++++ BTrees-4.7.1.tar.gz -> BTrees-4.7.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/BTreeModuleTemplate.c new/BTrees-4.7.2/BTrees/BTreeModuleTemplate.c --- old/BTrees-4.7.1/BTrees/BTreeModuleTemplate.c 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/BTreeModuleTemplate.c 2020-04-07 14:23:26.000000000 +0200 @@ -82,9 +82,11 @@ { if (overflow) { - /* Python 3 tends to have an exception already set, Python 2 not so much */ - if (!PyErr_Occurred()) - PyErr_SetString(PyExc_OverflowError, "couldn't convert integer to C long long"); + PyErr_Clear(); + /* Python 3 tends to have an exception already set, Python 2 not so + much. We want to consistently raise a TypeError. + */ + PyErr_SetString(PyExc_TypeError, "couldn't convert integer to C long long"); return 0; } else if (result == -1 && PyErr_Occurred()) @@ -106,7 +108,7 @@ long tmp; tmp = PyInt_AS_LONG(ob); if (tmp < 0) { - PyErr_SetString(PyExc_OverflowError, "unsigned value less than 0"); + PyErr_SetString(PyExc_TypeError, "unsigned value less than 0"); return 0; } return 1; @@ -166,7 +168,7 @@ long tmp; tmp = PyInt_AS_LONG(ob); if (tmp < 0) { - PyErr_SetString(PyExc_OverflowError, "unsigned value less than 0"); + PyErr_SetString(PyExc_TypeError, "unsigned value less than 0"); return 0; } (*value) = (unsigned PY_LONG_LONG)tmp; @@ -182,7 +184,14 @@ val = PyLong_AsUnsignedLongLong(ob); if (val == (unsigned long long)-1 && PyErr_Occurred()) + { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + { + PyErr_Clear(); + PyErr_SetString(PyExc_TypeError, "overflow error converting int to C long long"); + } return 0; + } (*value) = val; return 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/BTreeTemplate.c new/BTrees-4.7.2/BTrees/BTreeTemplate.c --- old/BTrees-4.7.1/BTrees/BTreeTemplate.c 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/BTreeTemplate.c 2020-04-07 14:23:26.000000000 +0200 @@ -1972,12 +1972,6 @@ } static PyObject * -BTree_has_key(BTree *self, PyObject *key) -{ - return _BTree_get(self, key, 1, _BGET_REPLACE_TYPE_ERROR); -} - -static PyObject * BTree_setdefault(BTree *self, PyObject *args) { PyObject *key; @@ -2082,6 +2076,21 @@ } static PyObject * +BTree_has_key(BTree *self, PyObject *key) +{ + int result = -1; + result = BTree_contains(self, key); + if (result == -1) { + return NULL; + } + + if (result) + Py_RETURN_TRUE; + Py_RETURN_FALSE; +} + + +static PyObject * BTree_addUnique(BTree *self, PyObject *args) { int grew; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/BucketTemplate.c new/BTrees-4.7.2/BTrees/BucketTemplate.c --- old/BTrees-4.7.1/BTrees/BucketTemplate.c 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/BucketTemplate.c 2020-04-07 14:23:26.000000000 +0200 @@ -1367,11 +1367,6 @@ return Py_None; } -static PyObject * -bucket_has_key(Bucket *self, PyObject *key) -{ - return _bucket_get(self, key, 1); -} static PyObject * bucket_setdefault(Bucket *self, PyObject *args) @@ -1475,6 +1470,20 @@ return result; } +static PyObject * +bucket_has_key(Bucket *self, PyObject *key) +{ + int result = -1; + result = bucket_contains(self, key); + if (result == -1) { + return NULL; + } + + if (result) + Py_RETURN_TRUE; + Py_RETURN_FALSE; +} + /* ** bucket_getm ** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/_datatypes.py new/BTrees-4.7.2/BTrees/_datatypes.py --- old/BTrees-4.7.1/BTrees/_datatypes.py 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/_datatypes.py 2020-04-07 14:23:26.000000000 +0200 @@ -55,7 +55,7 @@ """ Convert *item* into the correct format and return it. - If this cannot be done, raise an appropriate exception. + If this cannot be done, raise a :exc:`TypeError`. """ raise NotImplementedError @@ -239,7 +239,7 @@ # PyPy can raise ValueError converting a negative number to a # unsigned value. if isinstance(item, int_types): - raise OverflowError("Value out of range", item) + raise TypeError("Value out of range", item) raise TypeError(self._error_description) return self._as_python_type(item) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/intkeymacros.h new/BTrees-4.7.2/BTrees/intkeymacros.h --- old/BTrees-4.7.1/BTrees/intkeymacros.h 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/intkeymacros.h 2020-04-07 14:23:26.000000000 +0200 @@ -23,9 +23,15 @@ #define COPY_KEY_FROM_ARG(TARGET, ARG, STATUS) \ if (INT_CHECK(ARG)) { \ long vcopy = INT_AS_LONG(ARG); \ - if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \ + if (PyErr_Occurred()) { \ + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { \ + PyErr_Clear(); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ + } \ + (STATUS)=0; (TARGET)=0; \ + } \ else if ((int)vcopy != vcopy) { \ - PyErr_SetString(PyExc_OverflowError, "integer out of range"); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ (STATUS)=0; (TARGET)=0; \ } \ else TARGET = vcopy; \ @@ -55,13 +61,19 @@ #define COPY_KEY_FROM_ARG(TARGET, ARG, STATUS) \ if (INT_CHECK(ARG)) { \ long vcopy = INT_AS_LONG(ARG); \ - if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \ + if (PyErr_Occurred()) { \ + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { \ + PyErr_Clear(); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ + } \ + (STATUS)=0; (TARGET)=0; \ + } \ else if (vcopy < 0) { \ - PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned int"); \ + PyErr_SetString(PyExc_TypeError, "can't convert negative value to unsigned int"); \ (STATUS)=0; (TARGET)=0; \ } \ else if ((unsigned int)vcopy != vcopy) { \ - PyErr_SetString(PyExc_OverflowError, "integer out of range"); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ (STATUS)=0; (TARGET)=0; \ } \ else TARGET = vcopy; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/intvaluemacros.h new/BTrees-4.7.2/BTrees/intvaluemacros.h --- old/BTrees-4.7.1/BTrees/intvaluemacros.h 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/intvaluemacros.h 2020-04-07 14:23:26.000000000 +0200 @@ -29,9 +29,15 @@ #define COPY_VALUE_FROM_ARG(TARGET, ARG, STATUS) \ if (INT_CHECK(ARG)) { \ long vcopy = INT_AS_LONG(ARG); \ - if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \ + if (PyErr_Occurred()) { \ + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { \ + PyErr_Clear(); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ + } \ + (STATUS)=0; (TARGET)=0; \ + } \ else if ((int)vcopy != vcopy) { \ - PyErr_SetString(PyExc_OverflowError, "integer out of range"); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ (STATUS)=0; (TARGET)=0; \ } \ else TARGET = vcopy; \ @@ -62,13 +68,19 @@ #define COPY_VALUE_FROM_ARG(TARGET, ARG, STATUS) \ if (INT_CHECK(ARG)) { \ long vcopy = INT_AS_LONG(ARG); \ - if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \ + if (PyErr_Occurred()) { \ + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { \ + PyErr_Clear(); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ + } \ + (STATUS)=0; (TARGET)=0; \ + } \ else if (vcopy < 0) { \ - PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned int"); \ + PyErr_SetString(PyExc_TypeError, "can't convert negative value to unsigned int"); \ (STATUS)=0; (TARGET)=0; \ - } \ + } \ else if ((unsigned int)vcopy != vcopy) { \ - PyErr_SetString(PyExc_OverflowError, "integer out of range"); \ + PyErr_SetString(PyExc_TypeError, "integer out of range"); \ (STATUS)=0; (TARGET)=0; \ } \ else TARGET = vcopy; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/tests/common.py new/BTrees-4.7.2/BTrees/tests/common.py --- old/BTrees-4.7.1/BTrees/tests/common.py 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/tests/common.py 2020-04-07 14:23:26.000000000 +0200 @@ -390,7 +390,7 @@ self.assertFalse(issubclass(NonSub, type(t))) self.assertFalse(isinstance(NonSub(), type(t))) -class MappingBase(Base): +class MappingBase(Base): # pylint:disable=too-many-public-methods # Tests common to mappings (buckets, btrees) SUPPORTS_NEGATIVE_VALUES = True @@ -449,6 +449,19 @@ self.assertEqual(self._makeOne().get(1), None) self.assertEqual(self._makeOne().get(1, 'foo'), 'foo') + def testGetReturnsDefaultWrongTypes(self): + self.assertIsNone(self._makeOne().get('abc')) + self.assertEqual(self._makeOne().get('abc', 'def'), 'def') + + def testGetReturnsDefaultOverflowRanges(self): + too_big = 2 ** 64 + 1 + self.assertIsNone(self._makeOne().get(too_big)) + self.assertEqual(self._makeOne().get(too_big, 'def'), 'def') + + too_small = -too_big + self.assertIsNone(self._makeOne().get(too_small)) + self.assertEqual(self._makeOne().get(too_small, 'def'), 'def') + def testSetItemGetItemWorks(self): t = self._makeOne() t[1] = 1 @@ -475,14 +488,24 @@ self.assertEqual(len(t), len(addl), len(t)) def testHasKeyWorks(self): - from .._compat import PY2 t = self._makeOne() t[1] = 1 - if PY2: - self.assertTrue(t.has_key(1)) - self.assertTrue(1 in t) - self.assertTrue(0 not in t) - self.assertTrue(2 not in t) + self.assertTrue(t.has_key(1)) + + self.assertIn(1, t) + self.assertNotIn(0, t) + self.assertNotIn(2, t) + + def testHasKeyOverflowAndTypes(self): + t = self._makeOne() + + too_big = 2 ** 64 + 1 + too_small = -too_big + self.assertNotIn(too_big, t) + self.assertNotIn(too_small, t) + self.assertFalse(t.has_key(too_big)) + self.assertFalse(t.has_key(too_small)) + self.assertFalse(t.has_key('abc')) def testValuesWorks(self): t = self._makeOne() @@ -699,7 +722,7 @@ self.assertEqual(list(keys), []) self.assertEqual(list(t.iterkeys(max=50, min=200)), []) - def testSlicing(self): + def testSlicing(self): # pylint:disable=too-many-locals # Test that slicing of .keys()/.values()/.items() works exactly the # same way as slicing a Python list with the same contents. # This tests fixes to several bugs in this area, starting with @@ -809,7 +832,7 @@ self.assertEqual(list(t.iteritems()), list(t.items())) @uses_negative_keys_and_values - def testRangedIterators(self): + def testRangedIterators(self): # pylint:disable=too-many-locals t = self._makeOne() for keys in [], [-2], [1, 4], list(range(-170, 2000, 13)): @@ -1051,7 +1074,6 @@ self.skipTest("Needs bounded key and value") import struct - from .._compat import PY2 good = set() b = self._makeOne() @@ -1061,10 +1083,11 @@ # for values that are in range on most other platforms. And on Python 2, # PyInt_Check can fail with a TypeError starting at small values # like 2147483648. So we look for small longs and catch those errors - # even when we think we should be in range. + # even when we think we should be in range. In all cases, our code + # catches the unexpected error (OverflowError) and turns it into TypeError. long_is_32_bit = struct.calcsize('@l') < 8 - in_range_errors = (OverflowError, TypeError) if long_is_32_bit else () - out_of_range_errors = (OverflowError, TypeError) if long_is_32_bit and PY2 else (OverflowError,) + in_range_errors = TypeError + out_of_range_errors = TypeError def trial(i): i = int(i) @@ -1971,7 +1994,7 @@ key_type = None value_type = None def _getModule(self): - pass + raise NotImplementedError def testNames(self): names = ['Bucket', 'BTree', 'Set', 'TreeSet'] @@ -2143,11 +2166,11 @@ o1, o2 = self.getTwoValues() t = self._makeOne() k1 = SMALLEST_POSITIVE_65_BITS if self.SUPPORTS_NEGATIVE_KEYS else 2**64 + 1 - with self.assertRaises(OverflowError): + with self.assertRaises(TypeError): t[k1] = o1 t = self._makeOne() - with self.assertRaises(OverflowError): + with self.assertRaises(TypeError): t[LARGEST_NEGATIVE_65_BITS] = o1 class TestLongIntValues(TestLongIntSupport): @@ -2175,11 +2198,11 @@ k1, k2 = self.getTwoKeys() t = self._makeOne() v1 = SMALLEST_POSITIVE_65_BITS if self.SUPPORTS_NEGATIVE_VALUES else 2**64 + 1 - with self.assertRaises(OverflowError): + with self.assertRaises(TypeError): t[k1] = v1 t = self._makeOne() - with self.assertRaises(OverflowError): + with self.assertRaises(TypeError): t[k1] = LARGEST_NEGATIVE_65_BITS @@ -2199,8 +2222,8 @@ super(SetResult, self).setUp() _skip_if_pure_py_and_py_test(self) - self.Akeys = [1, 3, 5, 6] - self.Bkeys = [ 2, 3, 4, 6, 7] + self.Akeys = [1, 3, 5, 6] # pylint:disable=bad-whitespace + self.Bkeys = [ 2, 3, 4, 6, 7] # pylint:disable=bad-whitespace self.As = [makeset(self.Akeys) for makeset in self.builders()] self.Bs = [makeset(self.Bkeys) for makeset in self.builders()] self.emptys = [makeset() for makeset in self.builders()] @@ -2312,7 +2335,7 @@ else: self.assertEqual(list(C), want) - def testLargerInputs(self): + def testLargerInputs(self): # pylint:disable=too-many-locals from BTrees.IIBTree import IISet # pylint:disable=no-name-in-module from random import randint MAXSIZE = 200 @@ -2568,6 +2591,7 @@ # Tests common to all types: sets, buckets, and BTrees storage = None + db = None def setUp(self): super(ConflictTestBase, self).setUp() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/tests/testBTrees.py new/BTrees-4.7.2/BTrees/tests/testBTrees.py --- old/BTrees-4.7.1/BTrees/tests/testBTrees.py 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/tests/testBTrees.py 2020-04-07 14:23:26.000000000 +0200 @@ -114,14 +114,14 @@ t, keys = self._build_degenerate_tree() self.assertEqual(len(t), len(keys)) self.assertEqual(list(t.keys()), keys) - # has_key actually returns the depth of a bucket. - self.assertEqual(t.has_key(1), 4) - self.assertEqual(t.has_key(3), 4) - self.assertEqual(t.has_key(5), 6) - self.assertEqual(t.has_key(7), 5) - self.assertEqual(t.has_key(11), 5) + + self.assertTrue(t.has_key(1)) + self.assertTrue(t.has_key(3)) + self.assertTrue(t.has_key(5)) + self.assertTrue(t.has_key(7)) + self.assertTrue(t.has_key(11)) for i in 0, 2, 4, 6, 8, 9, 10, 12: - self.assertTrue(i not in t) + self.assertNotIn(i, t) def _checkRanges(self, tree, keys): self.assertEqual(len(tree), len(keys)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees/tests/test__datatypes.py new/BTrees-4.7.2/BTrees/tests/test__datatypes.py --- old/BTrees-4.7.1/BTrees/tests/test__datatypes.py 2020-03-22 17:38:33.000000000 +0100 +++ new/BTrees-4.7.2/BTrees/tests/test__datatypes.py 2020-04-07 14:23:26.000000000 +0200 @@ -36,7 +36,7 @@ pass def test_to_int_w_overflow(self): - self.assertRaises(OverflowError, to_int, 2**64) + self.assertRaises(TypeError, to_int, 2**64) def test_to_int_w_invalid(self): self.assertRaises(TypeError, to_int, ()) @@ -60,7 +60,7 @@ pass def test_to_long_w_overflow(self): - self.assertRaises(OverflowError, to_long, 2**64) + self.assertRaises(TypeError, to_long, 2**64) def test_to_long_w_invalid(self): self.assertRaises(TypeError, to_long, ()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees.egg-info/PKG-INFO new/BTrees-4.7.2/BTrees.egg-info/PKG-INFO --- old/BTrees-4.7.1/BTrees.egg-info/PKG-INFO 2020-03-22 17:38:34.000000000 +0100 +++ new/BTrees-4.7.2/BTrees.egg-info/PKG-INFO 2020-04-07 14:23:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: BTrees -Version: 4.7.1 +Version: 4.7.2 Summary: Scalable persistent object containers Home-page: https://github.com/zopefoundation/BTrees Author: Zope Foundation @@ -41,6 +41,24 @@ BTrees Changelog ================== + 4.7.2 (2020-04-07) + ================== + + - Fix more cases of C and Python inconsistency. The C implementation + now behaves like the Python implementation when it comes to integer + overflow for the integer keys for ``in``, ``get`` and ``has_key``. + Now they return False, the default value, and False, respectively in + both versions if the tested value would overflow or underflow. + Previously, the C implementation would raise ``OverflowError`` or + ``KeyError``, while the Python implementation functioned as + expected. See `issue 140 + <https://github.com/zopefoundation/BTrees/issues/140>`_. + + .. note:: + The unspecified true return values of ``has_key`` + have changed. + + 4.7.1 (2020-03-22) ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/BTrees.egg-info/SOURCES.txt new/BTrees-4.7.2/BTrees.egg-info/SOURCES.txt --- old/BTrees-4.7.1/BTrees.egg-info/SOURCES.txt 2020-03-22 17:38:34.000000000 +0100 +++ new/BTrees-4.7.2/BTrees.egg-info/SOURCES.txt 2020-04-07 14:23:27.000000000 +0200 @@ -83,6 +83,7 @@ BTrees/tests/test_utils.py docs/Makefile docs/api.rst +docs/changes.rst docs/conf.py docs/development.rst docs/index.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/CHANGES.rst new/BTrees-4.7.2/CHANGES.rst --- old/BTrees-4.7.1/CHANGES.rst 2020-03-22 17:38:34.000000000 +0100 +++ new/BTrees-4.7.2/CHANGES.rst 2020-04-07 14:23:26.000000000 +0200 @@ -2,6 +2,24 @@ BTrees Changelog ================== +4.7.2 (2020-04-07) +================== + +- Fix more cases of C and Python inconsistency. The C implementation + now behaves like the Python implementation when it comes to integer + overflow for the integer keys for ``in``, ``get`` and ``has_key``. + Now they return False, the default value, and False, respectively in + both versions if the tested value would overflow or underflow. + Previously, the C implementation would raise ``OverflowError`` or + ``KeyError``, while the Python implementation functioned as + expected. See `issue 140 + <https://github.com/zopefoundation/BTrees/issues/140>`_. + + .. note:: + The unspecified true return values of ``has_key`` + have changed. + + 4.7.1 (2020-03-22) ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/PKG-INFO new/BTrees-4.7.2/PKG-INFO --- old/BTrees-4.7.1/PKG-INFO 2020-03-22 17:38:34.000000000 +0100 +++ new/BTrees-4.7.2/PKG-INFO 2020-04-07 14:23:27.273066500 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: BTrees -Version: 4.7.1 +Version: 4.7.2 Summary: Scalable persistent object containers Home-page: https://github.com/zopefoundation/BTrees Author: Zope Foundation @@ -41,6 +41,24 @@ BTrees Changelog ================== + 4.7.2 (2020-04-07) + ================== + + - Fix more cases of C and Python inconsistency. The C implementation + now behaves like the Python implementation when it comes to integer + overflow for the integer keys for ``in``, ``get`` and ``has_key``. + Now they return False, the default value, and False, respectively in + both versions if the tested value would overflow or underflow. + Previously, the C implementation would raise ``OverflowError`` or + ``KeyError``, while the Python implementation functioned as + expected. See `issue 140 + <https://github.com/zopefoundation/BTrees/issues/140>`_. + + .. note:: + The unspecified true return values of ``has_key`` + have changed. + + 4.7.1 (2020-03-22) ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/docs/changes.rst new/BTrees-4.7.2/docs/changes.rst --- old/BTrees-4.7.1/docs/changes.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/BTrees-4.7.2/docs/changes.rst 2020-04-07 14:23:26.000000000 +0200 @@ -0,0 +1 @@ +.. include:: ../CHANGES.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/docs/index.rst new/BTrees-4.7.2/docs/index.rst --- old/BTrees-4.7.1/docs/index.rst 2020-03-22 17:38:34.000000000 +0100 +++ new/BTrees-4.7.2/docs/index.rst 2020-04-07 14:23:26.000000000 +0200 @@ -15,6 +15,7 @@ overview api development + changes ==================== Indices and tables diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/docs/overview.rst new/BTrees-4.7.2/docs/overview.rst --- old/BTrees-4.7.1/docs/overview.rst 2020-03-22 17:38:34.000000000 +0100 +++ new/BTrees-4.7.2/docs/overview.rst 2020-04-07 14:23:26.000000000 +0200 @@ -168,10 +168,10 @@ [1, 2, 3, 4] >>> [pair for pair in t.iteritems()] # new in ZODB 3.3 [(1, 'red'), (2, 'green'), (3, 'blue'), (4, 'spades')] - >>> t.has_key(4) # returns a true value, but exactly what undefined - 2 + >>> t.has_key(4) # returns a true value + True >>> t.has_key(5) - 0 + False >>> 4 in t # new in ZODB 3.3 True >>> 5 in t # new in ZODB 3.3 @@ -256,10 +256,10 @@ >>> list(s.keys()) # note that the lists are in sorted order [[1], [2], [3]] >>> s.has_key([3]) # and [3] is in the set - 1 + True >>> L2[0] = 5 # horrible -- the set is insane now >>> s.has_key([3]) # for example, it's insane this way - 0 + False >>> s OOSet([[1], [5], [3]]) >>> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/BTrees-4.7.1/setup.py new/BTrees-4.7.2/setup.py --- old/BTrees-4.7.1/setup.py 2020-03-22 17:38:34.000000000 +0100 +++ new/BTrees-4.7.2/setup.py 2020-04-07 14:23:26.000000000 +0200 @@ -12,7 +12,7 @@ # ############################################################################## from __future__ import print_function -version = '4.7.1' +version = '4.7.2' import os import sys