Hello community, here is the log from the commit of package python-Cython for openSUSE:Factory checked in at 2018-07-18 22:35:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Cython (Old) and /work/SRC/openSUSE:Factory/.python-Cython.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Cython" Wed Jul 18 22:35:45 2018 rev:40 rq:622245 version:0.28.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Cython/python-Cython-doc.changes 2018-05-30 12:36:55.897056240 +0200 +++ /work/SRC/openSUSE:Factory/.python-Cython.new/python-Cython-doc.changes 2018-07-18 22:35:48.470566925 +0200 @@ -1,0 +2,12 @@ +Thu Jul 12 03:33:30 UTC 2018 - a...@gmx.de + +- update to version 0.28.4: + * Bugs fixed + + Reallowing tp_clear() in a subtype of an @no_gc_clear extension + type generated an invalid C function call to the (non-existent) + base type implementation. (Github issue #2309) + + Exception catching based on a non-literal (runtime) tuple could + fail to match the exception. (Github issue #2425) + + Compile fix for CPython 3.7.0a2. (Github issue #2477) + +------------------------------------------------------------------- python-Cython.changes: same change Old: ---- Cython-0.28.3.tar.gz New: ---- Cython-0.28.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Cython-doc.spec ++++++ --- /var/tmp/diff_new_pack.KJQyXO/_old 2018-07-18 22:35:49.614563135 +0200 +++ /var/tmp/diff_new_pack.KJQyXO/_new 2018-07-18 22:35:49.638563056 +0200 @@ -20,7 +20,7 @@ # Tests currently fail randomly in OBS multiple local rund do not trigger them %bcond_with test Name: python-Cython-doc -Version: 0.28.3 +Version: 0.28.4 Release: 0 Summary: The Cython compiler for writing C extensions for the Python language License: Apache-2.0 ++++++ python-Cython.spec ++++++ --- /var/tmp/diff_new_pack.KJQyXO/_old 2018-07-18 22:35:49.694562870 +0200 +++ /var/tmp/diff_new_pack.KJQyXO/_new 2018-07-18 22:35:49.714562804 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Cython -Version: 0.28.3 +Version: 0.28.4 Release: 0 Summary: The Cython compiler for writing C extensions for the Python language License: Apache-2.0 ++++++ Cython-0.28.3.tar.gz -> Cython-0.28.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/.gitrev new/Cython-0.28.4/.gitrev --- old/Cython-0.28.3/.gitrev 2018-05-27 10:43:12.000000000 +0200 +++ new/Cython-0.28.4/.gitrev 2018-07-08 09:46:06.000000000 +0200 @@ -1 +1 @@ -d09232ab74e3183c0a44b40f1d3b44be6fea4f43 +69714807b2ab222fbf9cc6715f28c2f13ebe436c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/CHANGES.rst new/Cython-0.28.4/CHANGES.rst --- old/Cython-0.28.3/CHANGES.rst 2018-05-27 10:40:28.000000000 +0200 +++ new/Cython-0.28.4/CHANGES.rst 2018-07-08 09:18:10.000000000 +0200 @@ -2,6 +2,22 @@ Cython Changelog ================ +0.28.4 (2018-07-08) +=================== + +Bugs fixed +---------- + +* Reallowing ``tp_clear()`` in a subtype of an ``@no_gc_clear`` extension type + generated an invalid C function call to the (non-existent) base type implementation. + (Github issue #2309) + +* Exception catching based on a non-literal (runtime) tuple could fail to match the + exception. (Github issue #2425) + +* Compile fix for CPython 3.7.0a2. (Github issue #2477) + + 0.28.3 (2018-05-27) =================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/Cython/Compiler/ModuleNode.py new/Cython-0.28.4/Cython/Compiler/ModuleNode.py --- old/Cython-0.28.3/Cython/Compiler/ModuleNode.py 2018-05-27 10:40:28.000000000 +0200 +++ new/Cython-0.28.4/Cython/Compiler/ModuleNode.py 2018-07-08 09:18:10.000000000 +0200 @@ -1603,7 +1603,7 @@ code.putln("}") def generate_clear_function(self, scope, code, cclass_entry): - tp_slot = TypeSlots.GCDependentSlot("tp_clear") + tp_slot = TypeSlots.get_slot_by_name("tp_clear") slot_func = scope.mangle_internal("tp_clear") base_type = scope.parent_type.base_type if tp_slot.slot_code(scope) != slot_func: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/Cython/Shadow.py new/Cython-0.28.4/Cython/Shadow.py --- old/Cython-0.28.3/Cython/Shadow.py 2018-05-27 10:40:28.000000000 +0200 +++ new/Cython-0.28.4/Cython/Shadow.py 2018-07-08 09:45:52.000000000 +0200 @@ -1,7 +1,7 @@ # cython.* namespace for pure mode. from __future__ import absolute_import -__version__ = "0.28.3" +__version__ = "0.28.4" try: from __builtin__ import basestring diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/Cython/Utility/Coroutine.c new/Cython-0.28.4/Cython/Utility/Coroutine.c --- old/Cython-0.28.3/Cython/Utility/Coroutine.c 2018-05-27 10:40:28.000000000 +0200 +++ new/Cython-0.28.4/Cython/Utility/Coroutine.c 2018-07-08 09:18:10.000000000 +0200 @@ -1851,7 +1851,7 @@ } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 if (!$local_tstate_cname->exc_state.exc_type) #else if (!$local_tstate_cname->exc_type) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/Cython/Utility/Exceptions.c new/Cython-0.28.4/Cython/Utility/Exceptions.c --- old/Cython-0.28.3/Cython/Utility/Exceptions.c 2018-05-27 10:40:28.000000000 +0200 +++ new/Cython-0.28.4/Cython/Utility/Exceptions.c 2018-07-08 09:18:10.000000000 +0200 @@ -359,7 +359,7 @@ *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -403,7 +403,7 @@ PyObject *type = NULL, *value = NULL, *tb = NULL; #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 type = tstate->exc_state.exc_type; value = tstate->exc_state.exc_value; tb = tstate->exc_state.exc_traceback; @@ -455,7 +455,7 @@ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -472,7 +472,7 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -510,7 +510,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/Cython/Utility/ModuleSetupCode.c new/Cython-0.28.4/Cython/Utility/ModuleSetupCode.c --- old/Cython-0.28.3/Cython/Utility/ModuleSetupCode.c 2018-05-27 10:40:28.000000000 +0200 +++ new/Cython-0.28.4/Cython/Utility/ModuleSetupCode.c 2018-07-08 09:18:10.000000000 +0200 @@ -765,15 +765,48 @@ // so far, we only call PyErr_GivenExceptionMatches() with an exception type (not instance) as first argument // => optimise for that case +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + // the tighter subtype checking in Py3 allows faster out-of-order comparison + for (i=0; i<n; i++) { + if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; + } +#endif + for (i=0; i<n; i++) { + PyObject *t = PyTuple_GET_ITEM(tuple, i); + #if PY_MAJOR_VERSION < 3 + if (likely(exc_type == t)) return 1; + #endif + if (likely(PyExceptionClass_Check(t))) { + if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1; + } else { + // FIXME: Py3: PyErr_SetString(PyExc_TypeError, "catching classes that do not inherit from BaseException is not allowed"); + } + } + return 0; +} + static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { if (likely(err == exc_type)) return 1; if (likely(PyExceptionClass_Check(err))) { - return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); + if (likely(PyExceptionClass_Check(exc_type))) { + return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); + } else if (likely(PyTuple_Check(exc_type))) { + return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type); + } else { + // FIXME: Py3: PyErr_SetString(PyExc_TypeError, "catching classes that do not inherit from BaseException is not allowed"); + } } return PyErr_GivenExceptionMatches(err, exc_type); } static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { + // Only used internally with known exception types => pure safety check assertions. + assert(PyExceptionClass_Check(exc_type1)); + assert(PyExceptionClass_Check(exc_type2)); if (likely(err == exc_type1 || err == exc_type2)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/PKG-INFO new/Cython-0.28.4/PKG-INFO --- old/Cython-0.28.3/PKG-INFO 2018-05-27 10:43:27.000000000 +0200 +++ new/Cython-0.28.4/PKG-INFO 2018-07-08 09:46:07.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Cython -Version: 0.28.3 +Version: 0.28.4 Summary: The Cython compiler for writing C extensions for the Python language. Home-page: http://cython.org/ Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/tests/run/fstring.pyx new/Cython-0.28.4/tests/run/fstring.pyx --- old/Cython-0.28.3/tests/run/fstring.pyx 2018-05-27 10:40:28.000000000 +0200 +++ new/Cython-0.28.4/tests/run/fstring.pyx 2018-05-27 12:45:20.000000000 +0200 @@ -504,7 +504,7 @@ @cython.test_assert_path_exists( "//FormattedValueNode", - "//AddNode", + "//JoinedStrNode", ) def percent_s_unicode(u, int i): u""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/tests/run/no_gc_clear.pyx new/Cython-0.28.4/tests/run/no_gc_clear.pyx --- old/Cython-0.28.3/tests/run/no_gc_clear.pyx 2015-06-22 14:53:11.000000000 +0200 +++ new/Cython-0.28.4/tests/run/no_gc_clear.pyx 2018-07-08 09:18:10.000000000 +0200 @@ -56,6 +56,21 @@ pto.tp_clear(self) +cdef class ReallowTpClear(DisableTpClear): + """ + >>> import gc + >>> obj = ReallowTpClear() + >>> is_tp_clear_null(obj) + False + + >>> obj.attr = obj # create hard reference cycle + >>> del obj; _ignore = gc.collect() + + # Problem: cannot really validate that the cycle was cleaned up without using weakrefs etc... + """ + cdef public object attr + + def test_closure_without_clear(str x): """ >>> c = test_closure_without_clear('abc') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.28.3/tests/run/tryexcept.pyx new/Cython-0.28.4/tests/run/tryexcept.pyx --- old/Cython-0.28.3/tests/run/tryexcept.pyx 2015-06-22 14:53:11.000000000 +0200 +++ new/Cython-0.28.4/tests/run/tryexcept.pyx 2018-07-08 09:18:10.000000000 +0200 @@ -58,6 +58,36 @@ i = 3 return i + +exceptions = (ValueError, TypeError) + + +def single_except_global_tuple(x): + """ + >>> single_except_global_tuple(None) + 2 + >>> single_except_global_tuple(ValueError('test')) + 3 + >>> single_except_global_tuple(TypeError('test')) + 3 + >>> class TypeErrorSubtype(TypeError): pass + >>> single_except_global_tuple(TypeErrorSubtype('test')) + 3 + >>> single_except_global_tuple(AttributeError('test')) + Traceback (most recent call last): + AttributeError: test + """ + cdef int i + try: + i = 1 + if x: + raise x + i = 2 + except exceptions: + i = 3 + return i + + def double_except_no_raise(a,b): """ >>> double_except_no_raise(TypeError, ValueError) @@ -179,6 +209,10 @@ 2 >>> normal_and_bare_except_raise(ValueError('test'), TypeError) 3 + >>> normal_and_bare_except_raise(TypeError('test'), (TypeError, ValueError)) + 2 + >>> normal_and_bare_except_raise(ValueError('test'), (TypeError, ValueError)) + 2 >>> normal_and_bare_except_raise(None, TypeError) 1 """