<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
<blockquote type="cite">
<pre class="message">All three failures give the error message
OverflowError: Python int too large to convert to C long
from
File "sage/rings/polynomial/polynomial_integer_dense_flint.pyx", line 284, in sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint.__init__ (build/cythonized/sage/rings/polynomial/polynomial_integer_dense_flint.cpp:6548)
fmpz_poly_set_coeff_si(self.__poly, i, a)
Help on finding a fix would be appreciated.</pre>
</blockquote>
On line 282 of that file (assuming the version at
<a class="moz-txt-link-freetext" href="https://github.com/sagemath/sage/blob/master/src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx">https://github.com/sagemath/sage/blob/master/src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx</a>
is the same as the one in the Debian package).<br>
</p>
<p>"<span class="pl-k">if</span> <span class="pl-c1">type</span>(a)
<span class="pl-k">is</span> <span class="pl-k">int</span>:"<br>
<br>
If that conditional is true then the code takes a fast path, which
assumes that the value of "a" fits in a C long. <br>
<br>
In python 2 "int" was a type limited to the size of a c long, so
the check was appropriate. However in python 3 "int" is an
arbitrary precision type, so we need to check if it will fit in
the range of a C long.<br>
<br>
There are several other conditionals on types being "int" in the
file that presumably need fixing in the same way. I also spotted a
"isinstance(x0, long):" which i'm pretty sure will fail in python
3 as there is no type long in python 3.<br>
<br>
I have attached a completely untested patch.<br>
</p>
</body>
</html>