all patchbots fail on integer.pyx

41 views
Skip to first unread message

Frédéric Chapoton

unread,
Oct 21, 2021, 3:09:11 AMOct 21
to sage-devel
Hello,

it seems that all patchbots currently break on a doctest in integral.pyx, see below. The cause is not identified so far. Could be random-seed usage, changes in gmp, or anything else. Any idea ?

Frédéric

File "src/sage/rings/integer.pyx", line 6434, in sage.rings.integer.Integer._shift_helper
Failed example:
    try:
        print('Possible error output from gmp')
        1 << (2^60)
    except (MemoryError, OverflowError, RuntimeError):
        pass
    else:
        print("Failed to raise exception")
Expected:
    Possible error output from gmp...
Got:
    gmp: overflow in mpz type
    Possible error output from gmp

Lorenz Panny

unread,
Oct 21, 2021, 3:43:30 AMOct 21
to sage-...@googlegroups.com

This looks like a buffering issue: The test was apparently written
under the expectation that the Python print() would get flushed to
stdout before the GMP error gets printed in the library call, but
this is untrue if Python caches the output until after calling GMP.
Hence we're seeing the output lines in the wrong order.

I suspect passing flush=True to the print() call should fix it.

Matthias Koeppe

unread,
Oct 21, 2021, 5:01:50 PMOct 21
to sage-devel
I have opened https://trac.sagemath.org/ticket/32737 for this
Reply all
Reply to author
Forward
0 new messages