summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Rojas2020-07-05 11:50:50 +0200
committerAntonio Rojas2020-07-05 11:50:50 +0200
commit6f25e9b99cb2750d24af20cc3c145eac12beda99 (patch)
tree4b4538d49438ff2dc469c006839261685bb09dd0
parent59fc031252f34a223e3a0da9fbef1932d01e83c2 (diff)
downloadaur-6f25e9b99cb2750d24af20cc3c145eac12beda99.tar.gz
Drop python-future dependency
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD16
-rw-r--r--sagemath-cython-0.29.20.patch350
-rw-r--r--sagemath-ecl-20.4.patch (renamed from sagemath-ecl-20.04.patch)294
-rw-r--r--sagemath-python-3.8.patch47
5 files changed, 587 insertions, 131 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c92b55d6ccdc..6a24b1176d88 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = sagemath-git
pkgdesc = Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab
- pkgver = 9.2.beta2.r0.g69d2b2da28
+ pkgver = 9.2.beta3.r0.ga79b0fc01d
pkgrel = 1
url = http://www.sagemath.org
arch = x86_64
@@ -36,7 +36,6 @@ pkgbase = sagemath-git
depends = python-networkx
depends = python-pillow
depends = python-pplpy
- depends = python-future
depends = python-sphinx
depends = gap
depends = flintqs
@@ -99,7 +98,7 @@ pkgbase = sagemath-git
source = test-optional.patch
source = sagemath-cremona.patch
source = sagemath-singular-4.1.2.patch
- source = sagemath-ecl-20.04.patch
+ source = sagemath-ecl-20.4.patch
source = sagemath-ipython7.patch
source = sagemath-python-3.8.patch
source = sagemath-pexpect-4.8.patch
@@ -112,13 +111,13 @@ pkgbase = sagemath-git
sha256sums = 77aa8e99aae5da74a9486f01b603a0b5d224c3d13e9d9fab681fb71a6af149f1
sha256sums = 937074fa7a8a4e2aba9ea77ec622fe937985a1a9176c48460d51325ee877a4f5
sha256sums = 6f98488d0eb3a12b958cd1a34f85b7bee950ac756430371c1e134e564cbbf7d3
- sha256sums = c50b6bd6ee6e00fc15ec267ac3187e234e5564f6c346c74d7ddaa5dc5f1fcd22
+ sha256sums = 516fd1ed21e08ca4b16faf34e8998583ff8408128518073443e59622958e5a93
sha256sums = b2a7055bc380c1d86a9514540d985fc4bce3cea1ea865e13642f11b1bf0f6e50
- sha256sums = e55bb5df7d6ce65fc9d124b6b59407071f0c55d88f730e9467398f10cc87e66d
+ sha256sums = e3d394b818bb575c509f5113ccfab9a5283c7d43bda9d1503951c820cd7fd472
sha256sums = 5e6d1aa34959bd4369bd08a80648a5c7bc2d38e72c97e9a5f986e91f8a7aca07
sha256sums = aeb6bb7a8d40f3d3b3547ee5f1e67e876051d9463cd1e0000b497c4d0f3e2fe9
sha256sums = b881d4a6867a6f5360fd204e6a86fd27c6177c539b06f521402e2bcb5a6209cd
- sha256sums = 6bc0eb8a54800d745474d7d371efedfd96838574f32fb9e2714ab268ccad2df7
+ sha256sums = 5bd813b8cde1604a471687571e3872595ceeee2d21cb8ae21db33aab53e49adf
pkgname = sagemath-git
optdepends = cython: to compile cython code
diff --git a/PKGBUILD b/PKGBUILD
index 66f2716a81a1..502717fceabe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,14 +7,14 @@
pkgbase=sagemath-git
pkgname=(sagemath-git sagemath-jupyter-git)
-pkgver=9.2.beta2.r0.g69d2b2da28
+pkgver=9.2.beta3.r0.ga79b0fc01d
pkgrel=1
pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
arch=(x86_64)
url="http://www.sagemath.org"
license=(GPL)
depends=(ipython palp brial cliquer maxima-ecl gfan sympow nauty python-rpy2 python-fpylll python-psutil python-cypari2
- python-matplotlib python-scipy python-sympy python-networkx python-pillow python-pplpy python-future python-sphinx
+ python-matplotlib python-scipy python-sympy python-networkx python-pillow python-pplpy python-sphinx
gap flintqs lcalc lrcalc arb eclib zn_poly gd python-cvxopt pynac linbox m4rie rubiks pari-galdata pari-seadata-small planarity rankwidth tachyon
sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials
iml libgiac libhomfly libbraiding symmetrica three.js)
@@ -40,7 +40,7 @@ source=(git://git.sagemath.org/sage.git#branch=develop
test-optional.patch
sagemath-cremona.patch
sagemath-singular-4.1.2.patch
- sagemath-ecl-20.04.patch
+ sagemath-ecl-20.4.patch
sagemath-ipython7.patch
sagemath-python-3.8.patch
sagemath-pexpect-4.8.patch
@@ -53,13 +53,13 @@ sha256sums=('SKIP'
'77aa8e99aae5da74a9486f01b603a0b5d224c3d13e9d9fab681fb71a6af149f1'
'937074fa7a8a4e2aba9ea77ec622fe937985a1a9176c48460d51325ee877a4f5'
'6f98488d0eb3a12b958cd1a34f85b7bee950ac756430371c1e134e564cbbf7d3'
- 'c50b6bd6ee6e00fc15ec267ac3187e234e5564f6c346c74d7ddaa5dc5f1fcd22'
+ '516fd1ed21e08ca4b16faf34e8998583ff8408128518073443e59622958e5a93'
'b2a7055bc380c1d86a9514540d985fc4bce3cea1ea865e13642f11b1bf0f6e50'
- 'e55bb5df7d6ce65fc9d124b6b59407071f0c55d88f730e9467398f10cc87e66d'
+ 'e3d394b818bb575c509f5113ccfab9a5283c7d43bda9d1503951c820cd7fd472'
'5e6d1aa34959bd4369bd08a80648a5c7bc2d38e72c97e9a5f986e91f8a7aca07'
'aeb6bb7a8d40f3d3b3547ee5f1e67e876051d9463cd1e0000b497c4d0f3e2fe9'
'b881d4a6867a6f5360fd204e6a86fd27c6177c539b06f521402e2bcb5a6209cd'
- '6bc0eb8a54800d745474d7d371efedfd96838574f32fb9e2714ab268ccad2df7')
+ '5bd813b8cde1604a471687571e3872595ceeee2d21cb8ae21db33aab53e49adf')
pkgver() {
cd sage
@@ -74,8 +74,8 @@ prepare(){
patch -p1 -i ../sagemath-cremona.patch
# Fixes for singular 4.1.2 https://trac.sagemath.org/ticket/25993
patch -p1 -i ../sagemath-singular-4.1.2.patch
-# Fix build with ECL 20.04 https://trac.sagemath.org/ticket/22191
- patch -p1 -i ../sagemath-ecl-20.04.patch
+# Fix build with ECL 20.4 https://trac.sagemath.org/ticket/22191
+ patch -p1 -i ../sagemath-ecl-20.4.patch
# Fix segfault and tests with flint 2.6 https://trac.sagemath.org/ticket/29719
patch -p1 -i ../sagemath-flint-2.6.patch
diff --git a/sagemath-cython-0.29.20.patch b/sagemath-cython-0.29.20.patch
index a06ee1af8d74..e787b24679bc 100644
--- a/sagemath-cython-0.29.20.patch
+++ b/sagemath-cython-0.29.20.patch
@@ -11,11 +11,115 @@ index d519d37b61..6a477f755c 100644
"""
Division by coefficients.
+diff --git a/src/sage/algebras/weyl_algebra.py b/src/sage/algebras/weyl_algebra.py
+index 67965111f6..a267923655 100644
+--- a/src/sage/algebras/weyl_algebra.py
++++ b/src/sage/algebras/weyl_algebra.py
+@@ -567,8 +567,6 @@ class DifferentialWeylAlgebraElement(AlgebraElement):
+
+ return self.__class__(F, {t: D[t]._divide_if_possible(x) for t in D})
+
+- __div__ = __truediv__
+-
+ def factor_differentials(self):
+ """
+ Return a dict representing ``self`` with the differentials
+diff --git a/src/sage/categories/examples/lie_algebras.py b/src/sage/categories/examples/lie_algebras.py
+index 695bd7c1b1..3bcdd817da 100644
+--- a/src/sage/categories/examples/lie_algebras.py
++++ b/src/sage/categories/examples/lie_algebras.py
+@@ -261,7 +261,7 @@ class LieAlgebraFromAssociative(Parent, UniqueRepresentation):
+ return self.__class__(self.parent(), self.value * scalar)
+ return self.__class__(self.parent(), scalar * self.value)
+
+- def __div__(self, x, self_on_left=False):
++ def __truediv__(self, x, self_on_left=False):
+ """
+ Division by coefficients.
+
+diff --git a/src/sage/combinat/binary_tree.py b/src/sage/combinat/binary_tree.py
+index cb2b1376c7..774a758a6f 100644
+--- a/src/sage/combinat/binary_tree.py
++++ b/src/sage/combinat/binary_tree.py
+@@ -3183,7 +3183,6 @@ class BinaryTree(AbstractClonableTree, ClonableArray,
+ else:
+ return B([self[0], self[1].over(bt)])
+
+- __div__ = over
+ __truediv__ = over
+
+ @combinatorial_map(name="Under operation on Binary Trees")
+diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py
+index 0513e23409..f2572c077a 100644
+--- a/src/sage/combinat/partition.py
++++ b/src/sage/combinat/partition.py
+@@ -1054,8 +1054,6 @@ class Partition(CombinatorialElement):
+
+ return SkewPartition([self[:], p])
+
+- __div__ = __truediv__
+-
+ def power(self, k):
+ r"""
+ Return the cycle type of the `k`-th power of any permutation
+diff --git a/src/sage/combinat/tableau.py b/src/sage/combinat/tableau.py
+index da464af764..59c23d3852 100644
+--- a/src/sage/combinat/tableau.py
++++ b/src/sage/combinat/tableau.py
+@@ -785,8 +785,6 @@ class Tableau(ClonableList, metaclass=InheritComparisonClasscallMetaclass):
+ from sage.combinat.skew_tableau import SkewTableau
+ return SkewTableau(st)
+
+- __div__ = __truediv__
+-
+ def __call__(self, *cell):
+ r"""
+
diff --git a/src/sage/ext/fast_callable.pyx b/src/sage/ext/fast_callable.pyx
-index 86033d983b..43dafee742 100644
+index 86033d983b..580f115692 100644
--- a/src/sage/ext/fast_callable.pyx
+++ b/src/sage/ext/fast_callable.pyx
-@@ -960,28 +960,6 @@ cdef class Expression:
+@@ -422,39 +422,6 @@ def fast_callable(x, domain=None, vars=None,
+ Traceback (most recent call last):
+ ...
+ TypeError: unable to simplify to float approximation
+-
+- Check :trac:`24805`--if a fast_callable expression involves division
+- on a Python object, it will always prefer Python 3 semantics (e.g.
+- ``x / y`` will try ``x.__truediv__`` instead of ``x.__div__``, as if
+- ``from __future__ import division`` is in effect). However, for
+- classes that implement ``__div__`` but not ``__truediv__`` it will still
+- fall back on ``__div__`` for backwards-compatibility, but reliance on
+- this functionality is deprecated::
+-
+- sage: from sage.ext.fast_callable import ExpressionTreeBuilder
+- sage: etb = ExpressionTreeBuilder('x')
+- sage: x = etb.var('x')
+- sage: class One(object):
+- ....: def __div__(self, other):
+- ....: if not isinstance(other, Integer):
+- ....: return NotImplemented
+- ....: return 1 / other
+- sage: expr = One() / x
+- sage: f = fast_callable(expr, vars=[x])
+- sage: f(2) # py2
+- doctest:warning...:
+- DeprecationWarning: use of __truediv__ should be preferred over __div__
+- See https://trac.sagemath.org/24805 for details.
+- 1/2
+- sage: class ModernOne(One):
+- ....: def __truediv__(self, other):
+- ....: if not isinstance(other, Integer):
+- ....: return NotImplemented
+- ....: return 1 / other
+- sage: expr = ModernOne() / x
+- sage: f = fast_callable(expr, vars=[x])
+- sage: f(2)
+- 1/2
+ """
+ cdef Expression et
+ if isinstance(x, Expression):
+@@ -960,28 +927,6 @@ cdef class Expression:
"""
return _expression_binop_helper(s, o, op_truediv)
@@ -66,11 +170,24 @@ index 1d2c1bf447..d4e736b83e 100644
def __pow__(FastDoubleFunc left, right, dummy):
"""
EXAMPLES::
+diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py
+index 8e82e94168..ee3a8b5cfb 100644
+--- a/src/sage/geometry/polyhedron/base.py
++++ b/src/sage/geometry/polyhedron/base.py
+@@ -4932,8 +4932,6 @@ class Polyhedron_base(Element):
+ """
+ return self.dilation(1/scalar)
+
+- __div__ = __truediv__
+-
+ @coerce_binop
+ def convex_hull(self, other):
+ """
diff --git a/src/sage/libs/mpmath/ext_main.pyx b/src/sage/libs/mpmath/ext_main.pyx
-index 298d289fee..29704c0904 100644
+index ac89834fee..694cc089e7 100644
--- a/src/sage/libs/mpmath/ext_main.pyx
+++ b/src/sage/libs/mpmath/ext_main.pyx
-@@ -1590,19 +1590,6 @@ cdef class mpnumber:
+@@ -1586,19 +1586,6 @@ cdef class mpnumber:
"""
return binop(OP_MUL, self, other, global_opts)
@@ -91,10 +208,10 @@ index 298d289fee..29704c0904 100644
"""
Division of mpmath numbers. Compatible numerical types
diff --git a/src/sage/libs/ntl/ntl_GF2.pyx b/src/sage/libs/ntl/ntl_GF2.pyx
-index 5aa701f451..92742493ea 100644
+index 21f69956b7..1a03ed5ebd 100644
--- a/src/sage/libs/ntl/ntl_GF2.pyx
+++ b/src/sage/libs/ntl/ntl_GF2.pyx
-@@ -150,9 +150,6 @@ cdef class ntl_GF2(object):
+@@ -153,9 +153,6 @@ cdef class ntl_GF2(object):
GF2_div(r.x, (<ntl_GF2>self).x, (<ntl_GF2>other).x)
return r
@@ -105,10 +222,10 @@ index 5aa701f451..92742493ea 100644
"""
sage: o = ntl.GF2(1)
diff --git a/src/sage/libs/ntl/ntl_GF2E.pyx b/src/sage/libs/ntl/ntl_GF2E.pyx
-index ee6ab1c6ad..97005292e9 100644
+index f45ad616a9..f9072cbc61 100644
--- a/src/sage/libs/ntl/ntl_GF2E.pyx
+++ b/src/sage/libs/ntl/ntl_GF2E.pyx
-@@ -281,9 +281,6 @@ cdef class ntl_GF2E(object):
+@@ -284,9 +284,6 @@ cdef class ntl_GF2E(object):
GF2E_div(r.x, self.x, (<ntl_GF2E>other).x)
return r
@@ -119,10 +236,10 @@ index ee6ab1c6ad..97005292e9 100644
"""
EXAMPLES::
diff --git a/src/sage/libs/ntl/ntl_GF2X.pyx b/src/sage/libs/ntl/ntl_GF2X.pyx
-index 19dee74769..255ba60466 100644
+index f3817f9cac..b80766b4ec 100644
--- a/src/sage/libs/ntl/ntl_GF2X.pyx
+++ b/src/sage/libs/ntl/ntl_GF2X.pyx
-@@ -221,9 +221,6 @@ cdef class ntl_GF2X(object):
+@@ -224,9 +224,6 @@ cdef class ntl_GF2X(object):
raise ArithmeticError("self (=%s) is not divisible by b (=%s)" % (self, b))
return q
@@ -133,10 +250,10 @@ index 19dee74769..255ba60466 100644
"""
EXAMPLES::
diff --git a/src/sage/libs/ntl/ntl_ZZX.pyx b/src/sage/libs/ntl/ntl_ZZX.pyx
-index 228da08044..ef8ce2ba2c 100644
+index 22e945814a..4d602df903 100644
--- a/src/sage/libs/ntl/ntl_ZZX.pyx
+++ b/src/sage/libs/ntl/ntl_ZZX.pyx
-@@ -357,9 +357,6 @@ cdef class ntl_ZZX(object):
+@@ -360,9 +360,6 @@ cdef class ntl_ZZX(object):
result = make_ZZX_sig_off(q)
return result
@@ -147,10 +264,10 @@ index 228da08044..ef8ce2ba2c 100644
"""
Given polynomials a, b in ZZ[X], there exist polynomials q, r
diff --git a/src/sage/libs/ntl/ntl_ZZ_pEX.pyx b/src/sage/libs/ntl/ntl_ZZ_pEX.pyx
-index 07efc9ea16..e6f8b32b86 100644
+index b8f07db7c7..78b4216ac9 100644
--- a/src/sage/libs/ntl/ntl_ZZ_pEX.pyx
+++ b/src/sage/libs/ntl/ntl_ZZ_pEX.pyx
-@@ -376,9 +376,6 @@ cdef class ntl_ZZ_pEX(object):
+@@ -379,9 +379,6 @@ cdef class ntl_ZZ_pEX(object):
raise ArithmeticError("self (=%s) is not divisible by other (=%s)" % (self, other))
return r
@@ -161,10 +278,10 @@ index 07efc9ea16..e6f8b32b86 100644
"""
Given polynomials a, b in ZZ_pE[X], if p is prime and the defining modulus irreducible,
diff --git a/src/sage/libs/ntl/ntl_ZZ_pX.pyx b/src/sage/libs/ntl/ntl_ZZ_pX.pyx
-index b2336c1c9a..a3ac93fa81 100644
+index a31f9a4c80..0d18d06c4f 100644
--- a/src/sage/libs/ntl/ntl_ZZ_pX.pyx
+++ b/src/sage/libs/ntl/ntl_ZZ_pX.pyx
-@@ -404,9 +404,6 @@ cdef class ntl_ZZ_pX(object):
+@@ -407,9 +407,6 @@ cdef class ntl_ZZ_pX(object):
raise ArithmeticError("self (=%s) is not divisible by other (=%s)" % (self, other))
return r
@@ -175,10 +292,10 @@ index b2336c1c9a..a3ac93fa81 100644
"""
Given polynomials a, b in ZZ_p[X], if p is prime, then there exist polynomials q, r
diff --git a/src/sage/libs/ntl/ntl_lzz_p.pyx b/src/sage/libs/ntl/ntl_lzz_p.pyx
-index 7809288152..e6c2b5a305 100644
+index 582e6f088f..6363f05f79 100644
--- a/src/sage/libs/ntl/ntl_lzz_p.pyx
+++ b/src/sage/libs/ntl/ntl_lzz_p.pyx
-@@ -250,9 +250,6 @@ cdef class ntl_zz_p(object):
+@@ -253,9 +253,6 @@ cdef class ntl_zz_p(object):
sig_off()
return q
@@ -189,10 +306,10 @@ index 7809288152..e6c2b5a305 100644
"""
Return the n-th nonnegative power of self.
diff --git a/src/sage/libs/ntl/ntl_lzz_pX.pyx b/src/sage/libs/ntl/ntl_lzz_pX.pyx
-index c063e30548..72fa99ae7a 100644
+index d953a55248..1f2be8bd60 100644
--- a/src/sage/libs/ntl/ntl_lzz_pX.pyx
+++ b/src/sage/libs/ntl/ntl_lzz_pX.pyx
-@@ -349,9 +349,6 @@ cdef class ntl_zz_pX(object):
+@@ -352,9 +352,6 @@ cdef class ntl_zz_pX(object):
raise ArithmeticError("self (=%s) is not divisible by other (=%s)" % (self, other))
return q
@@ -202,11 +319,42 @@ index c063e30548..72fa99ae7a 100644
def __mod__(ntl_zz_pX self, other):
"""
Given polynomials a, b in ZZ[X], there exist polynomials q, r
+diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py
+index e136fb8055..a7b526dd83 100644
+--- a/src/sage/manifolds/differentiable/tensorfield.py
++++ b/src/sage/manifolds/differentiable/tensorfield.py
+@@ -2750,7 +2750,7 @@ class TensorField(ModuleElement):
+ f: M --> R
+ on U: (x, y) |--> 1/(x^2 + y^2 + 1)
+ on V: (u, v) |--> 2/(u^2 + v^2 + 2)
+- sage: s = a.__div__(f); s
++ sage: s = a.__truediv__(f); s
+ Tensor field of type (1,1) on the 2-dimensional differentiable
+ manifold M
+ sage: s.display(e_xy)
+@@ -2761,7 +2761,7 @@ class TensorField(ModuleElement):
+
+ Division by a number::
+
+- sage: s = a.__div__(2); s
++ sage: s = a.__truediv__(2); s
+ Tensor field of type (1,1) on the 2-dimensional differentiable
+ manifold M
+ sage: s.display(e_xy)
+@@ -2780,8 +2780,6 @@ class TensorField(ModuleElement):
+ resu._restrictions[dom] = rst / scalar
+ return resu
+
+- __div__ = __truediv__
+-
+ def __call__(self, *args):
+ r"""
+ The tensor field acting on 1-forms and vector fields as a
diff --git a/src/sage/matrix/matrix_gfpn_dense.pyx b/src/sage/matrix/matrix_gfpn_dense.pyx
-index ed9c0aaf09..97a9db20ff 100644
+index 42af34dc10..698af79b55 100644
--- a/src/sage/matrix/matrix_gfpn_dense.pyx
+++ b/src/sage/matrix/matrix_gfpn_dense.pyx
-@@ -1390,7 +1390,7 @@ cdef class Matrix_gfpn_dense(Matrix_dense):
+@@ -1392,7 +1392,7 @@ cdef class Matrix_gfpn_dense(Matrix_dense):
sig_off()
return new_mtx(mat, self)
@@ -239,7 +387,7 @@ index d274d9eec5..6c8e736e80 100644
r"""
Shorthand for ``self.contract(X)``.
diff --git a/src/sage/misc/lazy_import.pyx b/src/sage/misc/lazy_import.pyx
-index 16f04bfe8d..13453d79f1 100644
+index 6e2c662476..f759d953d9 100644
--- a/src/sage/misc/lazy_import.pyx
+++ b/src/sage/misc/lazy_import.pyx
@@ -640,19 +640,6 @@ cdef class LazyImport(object):
@@ -262,11 +410,24 @@ index 16f04bfe8d..13453d79f1 100644
def __floordiv__(left, right):
"""
TESTS::
+diff --git a/src/sage/misc/sage_input.py b/src/sage/misc/sage_input.py
+index 6c671e50f6..a9997770a0 100644
+--- a/src/sage/misc/sage_input.py
++++ b/src/sage/misc/sage_input.py
+@@ -1497,8 +1497,6 @@ class SageInputExpression(object):
+ """
+ return self._sie_binop('/', other)
+
+- __div__ = __truediv__
+-
+ def __add__(self, other):
+ r"""
+ Compute an expression tree for ``self + other``.
diff --git a/src/sage/modules/with_basis/indexed_element.pyx b/src/sage/modules/with_basis/indexed_element.pyx
-index 94d57d67e2..ebbcf3e1d9 100644
+index 4026f1947b..ad29f997e8 100644
--- a/src/sage/modules/with_basis/indexed_element.pyx
+++ b/src/sage/modules/with_basis/indexed_element.pyx
-@@ -883,20 +883,6 @@ cdef class IndexedFreeModuleElement(ModuleElement):
+@@ -886,20 +886,6 @@ cdef class IndexedFreeModuleElement(ModuleElement):
x_inv = B(x) ** -1
return type(self)(F, scal(x_inv, D))
@@ -287,6 +448,47 @@ index 94d57d67e2..ebbcf3e1d9 100644
def _unpickle_element(C, d):
"""
Unpickle an element in ``C`` given by ``d``.
+diff --git a/src/sage/plot/colors.py b/src/sage/plot/colors.py
+index 84da272fbb..9f12c0dbdb 100644
+--- a/src/sage/plot/colors.py
++++ b/src/sage/plot/colors.py
+@@ -801,7 +801,7 @@ class Color(object):
+ RGB color (0.29166666666666663, 0.286437908496732, 0.07794117647058824)
+ sage: vector((papayawhip / 2).rgb()) == vector((papayawhip * 0.5).rgb())
+ True
+- sage: yellow.__div__(1/4)
++ sage: yellow.__truediv__(1/4)
+ RGB color (0.0, 0.0, 0.0)
+
+ TESTS::
+@@ -822,27 +822,6 @@ class Color(object):
+ """
+ return self * (1 / float(right))
+
+- def __div__(self, right):
+- """
+- Return a color whose RGB coordinates are this color's
+- coordinates divided by a scalar.
+-
+- INPUT:
+-
+- - ``right`` -- a float-convertible, non-zero number
+-
+- OUTPUT:
+-
+- - a **new** instance of :class:`Color`
+-
+- EXAMPLES::
+-
+- sage: from sage.plot.colors import yellow
+- sage: yellow.__div__(4)
+- RGB color (0.25, 0.25, 0.0)
+- """
+- return self / right
+-
+ def __int__(self):
+ """
+ Return the integer representation of this colour.
diff --git a/src/sage/quivers/algebra_elements.pyx b/src/sage/quivers/algebra_elements.pyx
index 25968539fc..33f73a7820 100644
--- a/src/sage/quivers/algebra_elements.pyx
@@ -317,10 +519,10 @@ index 9514b16c4b..ec301dd731 100644
Traceback (most recent call last):
...
diff --git a/src/sage/rings/complex_mpc.pyx b/src/sage/rings/complex_mpc.pyx
-index 84546c2239..ceb052131f 100644
+index 108eb25989..748bdc0c24 100644
--- a/src/sage/rings/complex_mpc.pyx
+++ b/src/sage/rings/complex_mpc.pyx
-@@ -1596,7 +1596,7 @@ cdef class MPComplexNumber(sage.structure.element.FieldElement):
+@@ -1573,7 +1573,7 @@ cdef class MPComplexNumber(sage.structure.element.FieldElement):
mpc_norm(x.value, self.value, (<RealField_class>x._parent).rnd)
return x
@@ -329,7 +531,7 @@ index 84546c2239..ceb052131f 100644
r"""
Returns the quotient of ``left`` with ``self``, that is: ``left/self``
as a complex number.
-@@ -1609,7 +1609,7 @@ cdef class MPComplexNumber(sage.structure.element.FieldElement):
+@@ -1586,7 +1586,7 @@ cdef class MPComplexNumber(sage.structure.element.FieldElement):
sage: MPC = MPComplexField()
sage: a = MPC(2, 2)
@@ -339,7 +541,7 @@ index 84546c2239..ceb052131f 100644
sage: MPC(1)/a
0.250000000000000 - 0.250000000000000*I
diff --git a/src/sage/rings/complex_number.pyx b/src/sage/rings/complex_number.pyx
-index bc87388c1c..2b00351ffc 100644
+index 526f88d2fd..1e58da9183 100644
--- a/src/sage/rings/complex_number.pyx
+++ b/src/sage/rings/complex_number.pyx
@@ -836,7 +836,7 @@ cdef class ComplexNumber(sage.structure.element.FieldElement):
@@ -361,10 +563,10 @@ index bc87388c1c..2b00351ffc 100644
sage: CC(1)/a
0.500000000000000
diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 44936e6a6a..0cdea51d47 100644
+index 624122569b..e59f099586 100644
--- a/src/sage/rings/integer.pyx
+++ b/src/sage/rings/integer.pyx
-@@ -2024,7 +2024,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+@@ -2012,7 +2012,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
mpz_mul(x.value, self.value, (<Integer>right).value)
return x
@@ -373,11 +575,24 @@ index 44936e6a6a..0cdea51d47 100644
r"""
TESTS::
+diff --git a/src/sage/rings/padics/lattice_precision.py b/src/sage/rings/padics/lattice_precision.py
+index 6cb4f04d17..6e89a622b1 100644
+--- a/src/sage/rings/padics/lattice_precision.py
++++ b/src/sage/rings/padics/lattice_precision.py
+@@ -397,8 +397,6 @@ class pRational:
+ val = self._valuation - other._valuation
+ return self.__class__(self.p, self.x / other.x, self.exponent - other.exponent, valuation=val)
+
+- __div__ = __truediv__
+-
+ def _quo_rem(self, other):
+ """
+ Quotient with remainder.
diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index 3d657d1f94..9f31b91f05 100644
+index 924cc71986..b7f6ce35cd 100644
--- a/src/sage/rings/polynomial/polynomial_element.pyx
+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -2247,9 +2247,6 @@ cdef class Polynomial(CommutativeAlgebraElement):
+@@ -2227,9 +2227,6 @@ cdef class Polynomial(CommutativeAlgebraElement):
return wrapperdescr_fastcall(RingElement.__truediv__,
left, (right,), <object>NULL)
@@ -388,10 +603,10 @@ index 3d657d1f94..9f31b91f05 100644
"""
EXAMPLES::
diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx
-index 30b50ea497..a4f04d6edf 100644
+index 6a4b3eacb2..e922b82f8e 100644
--- a/src/sage/rings/rational.pyx
+++ b/src/sage/rings/rational.pyx
-@@ -2435,7 +2435,7 @@ cdef class Rational(sage.structure.element.FieldElement):
+@@ -2403,7 +2403,7 @@ cdef class Rational(sage.structure.element.FieldElement):
mpq_mul(x.value, self.value, (<Rational>right).value)
return x
@@ -452,10 +667,10 @@ index fdca7ec591..ec16091b33 100644
r"""
Return a tuple of strings of variable names of length ngens given
diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
-index 0791c72a70..8105a3a8ab 100644
+index b1a64b9cbb..f190233b28 100644
--- a/src/sage/structure/element.pyx
+++ b/src/sage/structure/element.pyx
-@@ -1600,77 +1600,6 @@ cdef class Element(SageObject):
+@@ -1606,77 +1606,6 @@ cdef class Element(SageObject):
"""
return coercion_model.bin_op(self, n, mul)
@@ -533,7 +748,7 @@ index 0791c72a70..8105a3a8ab 100644
def __truediv__(left, right):
"""
Top-level true division operator for :class:`Element` invoking
-@@ -3419,9 +3348,6 @@ cdef class Vector(ModuleElement):
+@@ -3425,9 +3354,6 @@ cdef class Vector(ModuleElement):
cpdef _pairwise_product_(Vector left, Vector right):
raise TypeError("unsupported operation for '%s' and '%s'"%(parent(left), parent(right)))
@@ -543,7 +758,7 @@ index 0791c72a70..8105a3a8ab 100644
def __truediv__(self, right):
right = py_scalar_to_element(right)
if isinstance(right, RingElement):
-@@ -3777,59 +3703,6 @@ cdef class Matrix(ModuleElement):
+@@ -3783,59 +3709,6 @@ cdef class Matrix(ModuleElement):
return left * ~right
return coercion_model.bin_op(left, right, truediv)
@@ -603,3 +818,60 @@ index 0791c72a70..8105a3a8ab 100644
cdef _vector_times_matrix_(matrix_right, Vector vector_left):
raise TypeError
+diff --git a/src/sage/structure/factorization.py b/src/sage/structure/factorization.py
+index b163e81a29..e50dc26a94 100644
+--- a/src/sage/structure/factorization.py
++++ b/src/sage/structure/factorization.py
+@@ -1173,8 +1173,6 @@ class Factorization(SageObject):
+ return self / Factorization([(other, 1)])
+ return self * other**-1
+
+- __div__ = __truediv__
+-
+ def value(self):
+ """
+ Return the product of the factors in the factorization, multiplied out.
+diff --git a/src/sage/tensor/modules/comp.py b/src/sage/tensor/modules/comp.py
+index dd28a630d2..ad60a401a9 100644
+--- a/src/sage/tensor/modules/comp.py
++++ b/src/sage/tensor/modules/comp.py
+@@ -1889,7 +1889,7 @@ class Components(SageObject):
+ sage: from sage.tensor.modules.comp import Components
+ sage: a = Components(QQ, [1,2,3], 1)
+ sage: a[:] = 1, 0, -3
+- sage: s = a.__div__(3) ; s
++ sage: s = a.__truediv__(3) ; s
+ 1-index components w.r.t. [1, 2, 3]
+ sage: s[:]
+ [1/3, 0, -1]
+@@ -1907,8 +1907,6 @@ class Components(SageObject):
+ result._comp[ind] = val / other
+ return result
+
+- __div__ = __truediv__
+-
+ def trace(self, pos1, pos2):
+ r"""
+ Index contraction.
+diff --git a/src/sage/tensor/modules/free_module_tensor.py b/src/sage/tensor/modules/free_module_tensor.py
+index daed9b8955..cdfe8f5f9d 100644
+--- a/src/sage/tensor/modules/free_module_tensor.py
++++ b/src/sage/tensor/modules/free_module_tensor.py
+@@ -2263,7 +2263,7 @@ class FreeModuleTensor(ModuleElement):
+ sage: e = M.basis('e')
+ sage: a = M.tensor((2,0), name='a')
+ sage: a[:] = [[4,0], [-2,5]]
+- sage: s = a.__div__(4) ; s
++ sage: s = a.__truediv__(4) ; s
+ Type-(2,0) tensor on the 2-dimensional vector space M over the
+ Rational Field
+ sage: s[:]
+@@ -2280,8 +2280,6 @@ class FreeModuleTensor(ModuleElement):
+ result._components[basis] = self._components[basis] / other
+ return result
+
+- __div__ = __truediv__
+-
+ def __call__(self, *args):
+ r"""
+ The tensor acting on linear forms and module elements as a multilinear
diff --git a/sagemath-ecl-20.04.patch b/sagemath-ecl-20.4.patch
index 0a0ecfcc9ddf..c7fbe5f78a43 100644
--- a/sagemath-ecl-20.04.patch
+++ b/sagemath-ecl-20.4.patch
@@ -1,5 +1,5 @@
diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py
-index 616c13d..430ba80 100644
+index 60cd737..7fa17ea 100644
--- a/src/sage/interfaces/interface.py
+++ b/src/sage/interfaces/interface.py
@@ -589,9 +589,9 @@ class Interface(WithEqualityById, ParentWithBase):
@@ -62,6 +62,15 @@ diff --git a/src/sage/libs/ecl.pxd b/src/sage/libs/ecl.pxd
index 4dd273f..f0b30de 100644
--- a/src/sage/libs/ecl.pxd
+++ b/src/sage/libs/ecl.pxd
+@@ -30,7 +30,7 @@ cdef extern from "ecl/ecl.h":
+ ctypedef long int cl_fixnum
+ ctypedef cl_fixnum cl_narg
+ ctypedef void *cl_object
+- ctypedef unsigned int cl_index
++ ctypedef unsigned long int cl_index
+
+ ctypedef enum ecl_option:
+ ECL_OPT_INCREMENTAL_GC = 0,
@@ -39,7 +39,6 @@ cdef extern from "ecl/ecl.h":
ECL_OPT_TRAP_SIGINT,
ECL_OPT_TRAP_SIGILL,
@@ -78,8 +87,29 @@ index 4dd273f..f0b30de 100644
ECL_OPT_HEAP_SIZE,
ECL_OPT_HEAP_SAFETY_AREA,
ECL_OPT_THREAD_INTERRUPT_SIGNAL,
+@@ -127,6 +125,7 @@ cdef extern from "ecl/ecl.h":
+ cl_object cl_cddr(cl_object x)
+ cl_object cl_rplaca(cl_object x, cl_object v)
+ cl_object cl_rplacd(cl_object x, cl_object v)
++ cl_object ecl_list1(cl_object a)
+
+ # string parsing and string IO
+
+@@ -147,6 +146,10 @@ cdef extern from "ecl/ecl.h":
+ int ecl_nvalues "NVALUES"
+ cl_object ecl_values "VALUES"(int n)
+
+- #Common Lisp "EQUAL" compatible hash function
++ # Common Lisp "EQUAL" compatible hash function
+
+ cl_object cl_sxhash(cl_object key)
++
++ # symbols
++
++ cl_object ecl_make_symbol(const char *name, const char *package)
+\ No newline at end of file
diff --git a/src/sage/libs/ecl.pyx b/src/sage/libs/ecl.pyx
-index e408866..fa24ac0 100644
+index 1f05f4a..978e19b 100644
--- a/src/sage/libs/ecl.pyx
+++ b/src/sage/libs/ecl.pyx
@@ -15,7 +15,7 @@ Library interface to Embeddable Common Lisp (ECL)
@@ -91,7 +121,7 @@ index e408866..fa24ac0 100644
from libc.signal cimport raise_ as signal_raise
from posix.signal cimport sigaction, sigaction_t
cimport cysignals.signals
-@@ -47,9 +47,14 @@ cdef extern from "eclsig.h":
+@@ -47,9 +47,16 @@ cdef extern from "eclsig.h":
void ecl_sig_off()
cdef sigaction_t ecl_sigint_handler
cdef sigaction_t ecl_sigbus_handler
@@ -99,13 +129,25 @@ index e408866..fa24ac0 100644
cdef sigaction_t ecl_sigsegv_handler
cdef mpz_t ecl_mpz_from_bignum(cl_object obj)
cdef cl_object ecl_bignum_from_mpz(mpz_t num)
-+ cdef int fegetexcept()
-+ cdef int feenableexcept(int)
-+ cdef int fedisableexcept(int)
-+ cdef int ecl_feflags
++ cdef cl_object conditions_to_handle_clobj
++ void safe_cl_boot(int argc, char** argv)
++ cl_object safe_cl_funcall(cl_object *error, cl_object fun, cl_object arg)
++ cl_object safe_cl_apply(cl_object *error, cl_object fun, cl_object args)
++ cl_object safe_cl_eval(cl_object *error, cl_object form)
++
cdef cl_object string_to_object(char * s):
return ecl_read_from_cstring(s)
+@@ -93,9 +100,6 @@ cdef void remove_node(cl_object node):
+
+ cdef cl_object list_of_objects
+
+-cdef cl_object safe_eval_clobj #our own error catching eval
+-cdef cl_object safe_apply_clobj #our own error catching apply
+-cdef cl_object safe_funcall_clobj #our own error catching funcall
+ cdef cl_object read_from_string_clobj #our own error catching reader
+
+ cdef bint ecl_has_booted = 0
@@ -139,7 +143,6 @@ def test_ecl_options():
ECL_OPT_TRAP_SIGINT = 1
ECL_OPT_TRAP_SIGILL = 1
@@ -140,13 +182,19 @@ index e408866..fa24ac0 100644
print('ECL_OPT_HEAP_SIZE = {0}'.format(
ecl_get_option(ECL_OPT_HEAP_SIZE)))
print('ECL_OPT_HEAP_SAFETY_AREA = {0}'.format(
-@@ -238,14 +243,12 @@ def init_ecl():
+@@ -231,10 +229,8 @@ def init_ecl():
+ RuntimeError: ECL is already initialized
+ """
+ global list_of_objects
+- global safe_eval_clobj
+- global safe_apply_clobj
+- global safe_funcall_clobj
+ global read_from_string_clobj
++ global conditions_to_handle_clobj
global ecl_has_booted
cdef char *argv[1]
cdef sigaction_t sage_action[32]
-+ cdef int sage_fpes
- cdef int i
-
+@@ -243,9 +239,6 @@ def init_ecl():
if ecl_has_booted:
raise RuntimeError("ECL is already initialized")
@@ -156,25 +204,19 @@ index e408866..fa24ac0 100644
#we keep our own GMP memory functions. ECL should not claim them
ecl_set_option(ECL_OPT_SET_GMP_MEMORY_FUNCTIONS,0);
-@@ -257,6 +263,8 @@ def init_ecl():
- for i in range(1,32):
- sigaction(i, NULL, &sage_action[i])
+@@ -259,19 +252,14 @@ def init_ecl():
-+ sage_fpes = fegetexcept()
-+
#initialize ECL
ecl_set_option(ECL_OPT_SIGNAL_HANDLING_THREAD, 0)
- cl_boot(1, argv)
-@@ -264,14 +272,12 @@ def init_ecl():
+- cl_boot(1, argv)
++ safe_cl_boot(1, argv)
+
#save signal handler from ECL
sigaction(SIGINT, NULL, &ecl_sigint_handler)
sigaction(SIGBUS, NULL, &ecl_sigbus_handler)
+ sigaction(SIGFPE, NULL, &ecl_sigfpe_handler)
sigaction(SIGSEGV, NULL, &ecl_sigsegv_handler)
-+ #save ECL's floating point exception flags
-+ ecl_feflags = fegetexcept()
-+
- #verify that no SIGCHLD handler was installed
- cdef sigaction_t sig_test
- sigaction(SIGCHLD, NULL, &sig_test)
@@ -184,56 +226,113 @@ index e408866..fa24ac0 100644
#and put the Sage signal handlers back
for i in range(1,32):
sigaction(i, &sage_action[i], NULL)
-@@ -276,6 +288,9 @@ def init_ecl():
- for i in range(1,32):
- sigaction(i, &sage_action[i], NULL)
+@@ -293,32 +281,8 @@ def init_ecl():
-+ fedisableexcept(ecl_feflags)
-+ feenableexcept(sage_fpes)
-+
- #initialise list of objects and bind to global variable
- # *SAGE-LIST-OF-OBJECTS* to make it rooted in the reachable tree for the GC
- list_of_objects=cl_cons(Cnil,cl_cons(Cnil,Cnil))
-@@ -319,7 +334,6 @@ def init_ecl():
- (values nil (princ-to-string cnd)))))
- """))
- safe_funcall_clobj=cl_eval(string_to_object(b"(symbol-function 'sage-safe-funcall)"))
+ read_from_string_clobj=cl_eval(string_to_object(b"(symbol-function 'read-from-string)"))
+
+- cl_eval(string_to_object(b"""
+- (defun sage-safe-eval (form)
+- (handler-case
+- (values (eval form))
+- (serious-condition (cnd)
+- (values nil (princ-to-string cnd)))))
+- """))
+- safe_eval_clobj=cl_eval(string_to_object(b"(symbol-function 'sage-safe-eval)"))
+-
+- cl_eval(string_to_object(b"""
+- (defun sage-safe-apply (func args)
+- (handler-case
+- (values (apply func args))
+- (serious-condition (cnd)
+- (values nil (princ-to-string cnd)))))
+- """))
-
+- safe_apply_clobj=cl_eval(string_to_object(b"(symbol-function 'sage-safe-apply)"))
+- cl_eval(string_to_object(b"""
+- (defun sage-safe-funcall (func arg)
+- (handler-case
+- (values (funcall func arg))
+- (serious-condition (cnd)
+- (values nil (princ-to-string cnd)))))
+- """))
+- safe_funcall_clobj=cl_eval(string_to_object(b"(symbol-function 'sage-safe-funcall)"))
++ conditions_to_handle_clobj=ecl_list1(ecl_make_symbol(b"SERIOUS-CONDITION", b"COMMON-LISP"))
++ insert_node_after(list_of_objects,conditions_to_handle_clobj)
+
ecl_has_booted = 1
- cdef cl_object ecl_safe_eval(cl_object form) except NULL:
+@@ -339,45 +303,46 @@ cdef cl_object ecl_safe_eval(cl_object form) except NULL:
+ ...
+ RuntimeError: ECL says: Console interrupt.
+ """
+- cdef cl_object s
++ cdef cl_object ret, error = NULL
++
+ ecl_sig_on()
+- cl_funcall(2,safe_eval_clobj,form)
++ ret = safe_cl_eval(&error,form)
+ ecl_sig_off()
+
+- if ecl_nvalues > 1:
+- s = si_coerce_to_base_string(ecl_values(1))
++ if error != NULL:
++ error = si_coerce_to_base_string(error)
+ raise RuntimeError("ECL says: {}".format(
+- char_to_str(ecl_base_string_pointer_safe(s))))
++ char_to_str(ecl_base_string_pointer_safe(error))))
+ else:
+- return ecl_values(0)
++ return ret
+
+ cdef cl_object ecl_safe_funcall(cl_object func, cl_object arg) except NULL:
+- cdef cl_object l, s
+- l = cl_cons(func,cl_cons(arg,Cnil));
++ cdef cl_object ret, error = NULL
+
+ ecl_sig_on()
+- cl_apply(2,safe_funcall_clobj,cl_cons(func,cl_cons(arg,Cnil)))
++ ret = safe_cl_funcall(&error,func,arg)
+ ecl_sig_off()
+
+- if ecl_nvalues > 1:
+- s = si_coerce_to_base_string(ecl_values(1))
++ if error != NULL:
++ error = si_coerce_to_base_string(error)
+ raise RuntimeError("ECL says: {}".format(
+- char_to_str(ecl_base_string_pointer_safe(s))))
++ char_to_str(ecl_base_string_pointer_safe(error))))
+ else:
+- return ecl_values(0)
++ return ret
+
+ cdef cl_object ecl_safe_apply(cl_object func, cl_object args) except NULL:
+- cdef cl_object s
++ cdef cl_object ret, error = NULL
++
+ ecl_sig_on()
+- cl_funcall(3,safe_apply_clobj,func,args)
++ ret = safe_cl_apply(&error,func,args)
+ ecl_sig_off()
+
+- if ecl_nvalues > 1:
+- s = si_coerce_to_base_string(ecl_values(1))
++ if error != NULL:
++ error = si_coerce_to_base_string(error)
+ raise RuntimeError("ECL says: {}".format(
+- char_to_str(ecl_base_string_pointer_safe(s))))
++ char_to_str(ecl_base_string_pointer_safe(error))))
+ else:
+- return ecl_values(0)
++ return ret
+
+ cdef cl_object ecl_safe_read_string(char * s) except NULL:
+ cdef cl_object o
diff --git a/src/sage/libs/eclsig.h b/src/sage/libs/eclsig.h
-index f9f2690..a7e1f40 100644
+index f9f2690..e249ccf 100644
--- a/src/sage/libs/eclsig.h
+++ b/src/sage/libs/eclsig.h
-@@ -9,24 +9,66 @@
-
-
+@@ -11,15 +11,18 @@
#include <signal.h>
-+
-+/* Rummage around to determine how ECL was configured */
-+#define ECL_AVOID_FPE_H /* Prevent some local includes */
-+#include <ecl/config-internal.h>
-+
-+#ifdef HAVE_FENV_H
-+#include <fenv.h>
-+#ifndef FE_ALL_EXCEPT
-+#define FE_ALL_EXCEPT FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INVALID
-+#endif
-+#else
-+#ifndef FE_ALL_EXCEPT
-+#define FE_ALL_EXCEPT 0
-+#endif
-+#define feclearexcept(flags) do {} while (0)
-+#endif
-+
-+#ifndef HAVE_FEENABLEEXCEPT
-+/* These are GNU extensions */
-+#define fegetexcept() 0
-+#define feenablexcept(flags) do {} while (0)
-+#define fdisableexcept(flags) do {} while (0)
-+#endif
-+
static struct sigaction ecl_sigint_handler;
static struct sigaction ecl_sigbus_handler;
+static struct sigaction ecl_sigfpe_handler;
@@ -242,8 +341,6 @@ index f9f2690..a7e1f40 100644
static struct sigaction sage_sigbus_handler;
+static struct sigaction sage_sigfpe_handler;
static struct sigaction sage_sigsegv_handler;
-+static int ecl_feflags;
-+static int sage_feflags;
static inline void set_ecl_signal_handler(void)
{
@@ -251,25 +348,66 @@ index f9f2690..a7e1f40 100644
sigaction(SIGBUS, &ecl_sigbus_handler, &sage_sigbus_handler);
+ sigaction(SIGFPE, &ecl_sigfpe_handler, &sage_sigfpe_handler);
sigaction(SIGSEGV, &ecl_sigsegv_handler, &sage_sigsegv_handler);
-+
-+ /* first clear pending floating point exceptions, if any */
-+ feclearexcept(FE_ALL_EXCEPT);
-+
-+ /* sage_feflags should be 0; we don't set them otherwise */
-+ sage_feflags = fedisableexcept(FE_ALL_EXCEPT);
-+ feenableexcept(ecl_feflags);
}
- static inline void unset_ecl_signal_handler(void)
+@@ -27,6 +30,7 @@ static inline void unset_ecl_signal_handler(void)
{
-+ /* clear pending exceptions and restore previous exception mask */
-+ feclearexcept(FE_ALL_EXCEPT);
-+ ecl_feflags = fedisableexcept(FE_ALL_EXCEPT);
-+ feenableexcept(sage_feflags);
-+
sigaction(SIGINT, &sage_sigint_handler, NULL);
sigaction(SIGBUS, &sage_sigbus_handler, NULL);
+ sigaction(SIGFPE, &sage_sigfpe_handler, NULL);
sigaction(SIGSEGV, &sage_sigsegv_handler, NULL);
}
+@@ -49,3 +53,52 @@ cl_object ecl_bignum_from_mpz(mpz_t num)
+ mpz_set(ecl_mpz_from_bignum(z), num);
+ return _ecl_big_register_copy(z);
+ }
++
++static inline void safe_cl_boot(int argc, char** argv) {
++ ECL_WITH_LISP_FPE_BEGIN {
++ cl_boot(argc, argv);
++ } ECL_WITH_LISP_FPE_END;
++}
++
++/* List of conditions to catch in the following functions. Is
++ * initialized after cl_boot in init_ecl. */
++static cl_object conditions_to_handle_clobj = ECL_NIL;
++
++static inline cl_object safe_cl_funcall(cl_object *error, cl_object fun, cl_object arg) {
++ cl_object ret = NULL;
++ cl_env_ptr the_env = ecl_process_env();
++ ECL_WITH_LISP_FPE_BEGIN {
++ ECL_HANDLER_CASE_BEGIN(the_env, conditions_to_handle_clobj) {
++ ret = cl_funcall(2, fun, arg);
++ } ECL_HANDLER_CASE(1, condition) {
++ *error = cl_princ_to_string(condition);
++ } ECL_HANDLER_CASE_END;
++ } ECL_WITH_LISP_FPE_END;
++ return ret;
++}
++
++static inline cl_object safe_cl_apply(cl_object *error, cl_object fun, cl_object args) {
++ cl_object ret = NULL;
++ cl_env_ptr the_env = ecl_process_env();
++ ECL_WITH_LISP_FPE_BEGIN {
++ ECL_HANDLER_CASE_BEGIN(the_env, conditions_to_handle_clobj) {
++ ret = cl_apply(2, fun, args);
++ } ECL_HANDLER_CASE(1, condition) {
++ *error = cl_princ_to_string(condition);
++ } ECL_HANDLER_CASE_END;
++ } ECL_WITH_LISP_FPE_END;
++ return ret;
++}
++
++static inline cl_object safe_cl_eval(cl_object *error, cl_object form) {
++ cl_object ret = NULL;
++ cl_env_ptr the_env = ecl_process_env();
++ ECL_WITH_LISP_FPE_BEGIN {
++ ECL_HANDLER_CASE_BEGIN(the_env, conditions_to_handle_clobj) {
++ ret = cl_eval(form);
++ } ECL_HANDLER_CASE(1, condition) {
++ *error = cl_princ_to_string(condition);
++ } ECL_HANDLER_CASE_END;
++ } ECL_WITH_LISP_FPE_END;
++ return ret;
++}
diff --git a/sagemath-python-3.8.patch b/sagemath-python-3.8.patch
index 1ae3cfb0606e..6664c90b59d7 100644
--- a/sagemath-python-3.8.patch
+++ b/sagemath-python-3.8.patch
@@ -72,6 +72,53 @@ index 6051e513fd..c20c21c8ed 100644
[1, 2, 3]
Note that ``hello!`` actually gets printed twice in
+diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py
+index 8d719b2910..c9c5f7a4c9 100644
+--- a/src/sage/combinat/blob_algebra.py
++++ b/src/sage/combinat/blob_algebra.py
+@@ -327,12 +327,12 @@ class BlobDiagrams(Parent, UniqueRepresentation):
+ sage: BD3 = BlobDiagrams(3)
+ sage: for b in BD3: b
+ ({}, {{-3, 3}, {-2, -1}, {1, 2}})
+- ({{1, 2}}, {{-3, 3}, {-2, -1}})
+ ({{-2, -1}}, {{-3, 3}, {1, 2}})
++ ({{1, 2}}, {{-3, 3}, {-2, -1}})
+ ({{-2, -1}, {1, 2}}, {{-3, 3}})
+ ({{-3, 3}}, {{-2, -1}, {1, 2}})
+- ({{-3, 3}, {1, 2}}, {{-2, -1}})
+ ({{-3, 3}, {-2, -1}}, {{1, 2}})
++ ({{-3, 3}, {1, 2}}, {{-2, -1}})
+ ({{-3, 3}, {-2, -1}, {1, 2}}, {})
+ ({}, {{-3, -2}, {-1, 3}, {1, 2}})
+ ({{1, 2}}, {{-3, -2}, {-1, 3}})
+@@ -400,11 +400,11 @@ class BlobAlgebra(CombinatorialFreeModule):
+ sage: B4 = algebras.Blob(4, q, r, s)
+ sage: B = list(B4.basis())
+ sage: B[2]
+- B({{-4, -3}}, {{-2, -1}, {1, 2}, {3, 4}})
++ B({{1, 2}}, {{-4, -3}, {-2, -1}, {3, 4}})
+ sage: B[4]
+ B({{3, 4}}, {{-4, -3}, {-2, -1}, {1, 2}})
+ sage: B[2] * B[4]
+- q*r*s*B({}, {{-4, -3}, {-2, -1}, {1, 2}, {3, 4}})
++ q*s*B({{1, 2}}, {{-4, -3}, {-2, -1}, {3, 4}})
+
+ REFERENCES:
+
+@@ -585,11 +585,11 @@ class BlobAlgebra(CombinatorialFreeModule):
+ sage: B = B4.basis()
+ sage: BD = B.keys()
+ sage: BD[2]
+- ({{-4, -3}}, {{-2, -1}, {1, 2}, {3, 4}})
++ ({{1, 2}}, {{-4, -3}, {-2, -1}, {3, 4}})
+ sage: BD[4]
+ ({{3, 4}}, {{-4, -3}, {-2, -1}, {1, 2}})
+ sage: B4.product_on_basis(BD[2], BD[4])
+- q*r*s*B({}, {{-4, -3}, {-2, -1}, {1, 2}, {3, 4}})
++ q*s*B({{1, 2}}, {{-4, -3}, {-2, -1}, {3, 4}})
+ sage: all(len((x*y).support()) == 1 for x in B for y in B)
+ True
+ """
diff --git a/src/sage/combinat/colored_permutations.py b/src/sage/combinat/colored_permutations.py
index 2227ee6f29..298becbadc 100644
--- a/src/sage/combinat/colored_permutations.py