bump a bunch of python libs to fix py35 support

This commit is contained in:
Domen Kožar 2015-09-15 16:16:06 +02:00
parent 8836c58dc0
commit 81b05b4a48
2 changed files with 12 additions and 160 deletions

View file

@ -1,146 +0,0 @@
From be19c1f32e4d430092c029f17984f0087a2b2087 Mon Sep 17 00:00:00 2001
From: Jim Fulton <jim@zope.com>
Date: Mon, 19 May 2014 19:52:43 -0400
Subject: [PATCH 1/2] Fixed: integer overflow on 32-bit machines wasn't
detected correctly under Python 3.
---
BTrees/intkeymacros.h | 7 ++++---
BTrees/intvaluemacros.h | 3 ++-
BTrees/tests/testBTrees.py | 11 +++++++++--
BTrees/tests/test_IIBTree.py | 2 ++
CHANGES.rst | 2 ++
5 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/BTrees/intkeymacros.h b/BTrees/intkeymacros.h
index d439aa0..f9244b5 100644
--- a/BTrees/intkeymacros.h
+++ b/BTrees/intkeymacros.h
@@ -19,9 +19,10 @@
#define KEY_CHECK INT_CHECK
#define COPY_KEY_TO_OBJECT(O, K) O=INT_FROM_LONG(K)
#define COPY_KEY_FROM_ARG(TARGET, ARG, STATUS) \
- if (INT_CHECK(ARG)) { \
- long vcopy = INT_AS_LONG(ARG); \
- if ((int)vcopy != vcopy) { \
+ if (INT_CHECK(ARG)) { \
+ long vcopy = INT_AS_LONG(ARG); \
+ if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \
+ else if ((int)vcopy != vcopy) { \
PyErr_SetString(PyExc_TypeError, "integer out of range"); \
(STATUS)=0; (TARGET)=0; \
} \
diff --git a/BTrees/intvaluemacros.h b/BTrees/intvaluemacros.h
index b77a5c9..3072eea 100644
--- a/BTrees/intvaluemacros.h
+++ b/BTrees/intvaluemacros.h
@@ -23,7 +23,8 @@
#define COPY_VALUE_FROM_ARG(TARGET, ARG, STATUS) \
if (INT_CHECK(ARG)) { \
long vcopy = INT_AS_LONG(ARG); \
- if ((int)vcopy != vcopy) { \
+ if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \
+ else if ((int)vcopy != vcopy) { \
PyErr_SetString(PyExc_TypeError, "integer out of range"); \
(STATUS)=0; (TARGET)=0; \
} \
diff --git a/BTrees/tests/testBTrees.py b/BTrees/tests/testBTrees.py
index 50f5b43..31d641d 100644
--- a/BTrees/tests/testBTrees.py
+++ b/BTrees/tests/testBTrees.py
@@ -11,8 +11,11 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
+import sys
import unittest
+python3 = sys.version_info >= (3, )
+
from BTrees.tests.common import permutations
@@ -451,8 +454,12 @@ def test32(self):
# the characteristics change to match the 64 bit version, please
# feel free to change.
big = BTrees.family32.maxint + 1
- self.assertRaises(TypeError, s.insert, big)
- self.assertRaises(TypeError, s.insert, BTrees.family32.minint - 1)
+ if python3:
+ expected_exception = OverflowError
+ else:
+ expected_exception = TypeError
+ self.assertRaises(expected_exception, s.insert,
+ BTrees.family32.minint - 1)
self.check_pickling(BTrees.family32)
def test64(self):
diff --git a/BTrees/tests/test_IIBTree.py b/BTrees/tests/test_IIBTree.py
index 72e95b2..fe776b8 100644
--- a/BTrees/tests/test_IIBTree.py
+++ b/BTrees/tests/test_IIBTree.py
@@ -113,6 +113,8 @@ def trial(i):
i = int(i)
try:
b[i] = 0
+ except OverflowError:
+ self.assertRaises(OverflowError, b.__setitem__, 0, i)
except TypeError:
self.assertRaises(TypeError, b.__setitem__, 0, i)
else:
diff --git a/CHANGES.rst b/CHANGES.rst
index 4696be3..e3869ff 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,8 @@
``BTrees`` Changelog
====================
+- Fixed: integer overflow on 32-bit machines wasn't detected correctly
+ under Python 3.
4.0.9 (unreleased)
------------------
--
2.0.4
From 11a51d2a12bb9904e96349ff86e78e24a0ebe51a Mon Sep 17 00:00:00 2001
From: Jim Fulton <jim@zope.com>
Date: Wed, 21 May 2014 07:33:06 -0400
Subject: [PATCH 2/2] added back test mistakedly removed.
We have to check both TypeError and OverflowError. On Python3 32-bit,
we'll get an OverflowError, otherwise, we get type error.
---
BTrees/tests/testBTrees.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/BTrees/tests/testBTrees.py b/BTrees/tests/testBTrees.py
index 31d641d..d9be43a 100644
--- a/BTrees/tests/testBTrees.py
+++ b/BTrees/tests/testBTrees.py
@@ -453,13 +453,13 @@ def test32(self):
# this next bit illustrates an, um, "interesting feature". If
# the characteristics change to match the 64 bit version, please
# feel free to change.
- big = BTrees.family32.maxint + 1
- if python3:
- expected_exception = OverflowError
- else:
- expected_exception = TypeError
- self.assertRaises(expected_exception, s.insert,
- BTrees.family32.minint - 1)
+ try: s.insert(BTrees.family32.maxint + 1)
+ except (TypeError, OverflowError): pass
+ else: self.assert_(False)
+
+ try: s.insert(BTrees.family32.minint - 1)
+ except (TypeError, OverflowError): pass
+ else: self.assert_(False)
self.check_pickling(BTrees.family32)
def test64(self):
--
2.0.4

View file

@ -2527,11 +2527,11 @@ let
};
pytest = buildPythonPackage rec {
name = "pytest-2.7.2";
name = "pytest-2.7.3";
src = pkgs.fetchurl {
url = "http://pypi.python.org/packages/source/p/pytest/${name}.tar.gz";
sha256 = "b30457f735420d0000d10a44bbd478cf03f8bf20e25bd77248f9bab40f4fd6a4";
sha256 = "1z4yi986f9n0p8qmzmn21m21m8j1x78hk3505f89baqm6pdw7afm";
};
preCheck = ''
@ -7920,11 +7920,11 @@ let
Mako = buildPythonPackage rec {
name = "Mako-1.0.1";
name = "Mako-1.0.2";
src = pkgs.fetchurl {
url = "http://pypi.python.org/packages/source/M/Mako/${name}.tar.gz";
md5 = "9f0aafd177b039ef67b90ea350497a54";
sha256 = "17k7jy3byi4hj6ksszib6gxbf6n7snnnirnbrdldn848abjc4l15";
};
buildInputs = with self; [ markupsafe nose mock ];
@ -9952,11 +9952,11 @@ let
pep8 = buildPythonPackage rec {
name = "pep8-${version}";
version = "1.5.7";
version = "1.6.2";
src = pkgs.fetchurl {
url = "http://pypi.python.org/packages/source/p/pep8/${name}.tar.gz";
md5 = "f6adbdd69365ecca20513c709f9b7c93";
sha256 = "1zybkcdw1sx84dvkfss96nhykqg9bc0cdpwpl4k9wlxm61bf7dxq";
};
meta = {
@ -11148,11 +11148,11 @@ let
};
pyflakes = buildPythonPackage rec {
name = "pyflakes-0.8.1";
name = "pyflakes-0.9.2";
src = pkgs.fetchurl {
url = "http://pypi.python.org/packages/source/p/pyflakes/${name}.tar.gz";
md5 = "905fe91ad14b912807e8fdc2ac2e2c23";
sha256 = "0pvawddspdq0y22dbraq5gld9qr6rwa7zhmpfhl2b7v9rqiiqs82";
};
buildInputs = with self; [ unittest2 ];
@ -15825,15 +15825,13 @@ let
BTrees = self.buildPythonPackage rec {
name = "BTrees-4.0.8";
patches = [ ./../development/python-modules/btrees_interger_overflow.patch ];
name = "BTrees-4.1.4";
propagatedBuildInputs = with self; [ persistent zope_interface transaction ];
src = pkgs.fetchurl {
url = "https://pypi.python.org/packages/source/B/BTrees/${name}.tar.gz";
md5 = "7f5df4cf8dd50fb0c584c0929a406c92";
sha256 = "1avvhkd7rvp3rzhw20v6ank8a8m9a1lmh99c4gjjsa1ry0zsri3y";
};
meta = {
@ -16244,11 +16242,11 @@ let
zope_testing = buildPythonPackage rec {
name = "zope.testing-${version}";
version = "4.1.3";
version = "4.5.0";
src = pkgs.fetchurl {
url = "http://pypi.python.org/packages/source/z/zope.testing/${name}.tar.gz";
md5 = "6c73c5b668a67fdc116a25b884058ed9";
sha256 = "1yvglxhzvhl45mndvn9gskx2ph30zz1bz7rrlyfs62fv2pvih90s";
};
doCheck = !isPyPy;