Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #26992: Fix new (lib) gap on py3
There are py3-specific bugs in the new lib gap, as of #22626. Some of them stem from error handler not being fully string/bytes clean. {{{ 3$ ./sage -tp src/sage/libs/gap/util.pyx Running doctests with ID 2019-01-02-09-11-48-97f4ca0c. Git branch: HEAD Using --optional=dochtml,memlimit,mpir,python2,sage Doctesting 1 file using 8 threads. sage -t --warn-long 46.7 src/sage/libs/gap/util.pyx ********************************************************************** File "src/sage/libs/gap/util.pyx", line 389, in sage.libs.gap.util.NULL Failed example: libgap.eval('Complex Field with 53 bits of precision;') Expected: Traceback (most recent call last): ... ValueError: libGAP: Error, Variable: 'Complex' must have a value Syntax error: ; expected in stream:1 Complex Field with 53 bits of precision;; ^^^^^^^^^^^^ Error, Variable: 'with' must have a value Syntax error: ; expected in stream:1 Complex Field with 53 bits of precision;; ^^^^^^^^^^^^^^^^^^^^ Error, Variable: 'bits' must have a value Syntax error: ; expected in stream:1 Complex Field with 53 bits of precision;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error, Variable: 'precision' must have a value Got: RuntimeError: Error, Variable: 'Complex' must have a value <BLANKLINE> The above exception was the direct cause of the following exception: <BLANKLINE> Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cec5af8> returned a result with an error set Exception ignored in: 'sage.libs.gap.util.error_handler' Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cec5af8> returned a result with an error set RuntimeError: Syntax error: ; expected in stream:1 Complex Field with 53 bits of precision;; ^^^^^^^^^^^^^^^^^^^^ Error, Variable: 'bits' must have a value <BLANKLINE> The above exception was the direct cause of the following exception: <BLANKLINE> Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cc76030> returned a result with an error set Exception ignored in: 'sage.libs.gap.util.error_handler' Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cc76030> returned a result with an error set Traceback (most recent call last): File "/home/dimpase/sagepy3/local/lib/python3.6/site- packages/sage/doctest/forker.py", line 671, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/dimpase/sagepy3/local/lib/python3.6/site- packages/sage/doctest/forker.py", line 1086, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.gap.util.NULL[4]>", line 1, in <module> libgap.eval('Complex Field with 53 bits of precision;') File "sage/libs/gap/libgap.pyx", line 410, in sage.libs.gap.libgap.Gap.eval (build/cythonized/sage/libs/gap/libgap.c:4360) elem = make_any_gap_element(self, gap_eval(gap_command)) File "sage/libs/gap/util.pyx", line 442, in sage.libs.gap.util.gap_eval (build/cythonized/sage/libs/gap/util.c:6328) raise ValueError('can only evaluate a single statement') ValueError: can only evaluate a single statement ********************************************************************** File "src/sage/libs/gap/util.pyx", line 410, in sage.libs.gap.util.NULL Failed example: libgap.eval('Complex Field with 53 bits of precision;') Expected: Traceback (most recent call last): ... ValueError: libGAP: Error, Variable: 'Complex' must have a value ... Error, Variable: 'precision' must have a value Got: RuntimeError: Error, Variable: 'Complex' must have a value <BLANKLINE> The above exception was the direct cause of the following exception: <BLANKLINE> Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cec5bb0> returned a result with an error set Exception ignored in: 'sage.libs.gap.util.error_handler' Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cec5bb0> returned a result with an error set RuntimeError: Syntax error: ; expected in stream:1 Complex Field with 53 bits of precision;; ^^^^^^^^^^^^^^^^^^^^ Error, Variable: 'bits' must have a value <BLANKLINE> The above exception was the direct cause of the following exception: <BLANKLINE> Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cc77030> returned a result with an error set Exception ignored in: 'sage.libs.gap.util.error_handler' Traceback (most recent call last): File "sage/libs/gap/util.pyx", line 510, in sage.libs.gap.util.extract_libgap_errout (build/cythonized/sage/libs/gap/util.c:6662) SystemError: <built-in method replace of str object at 0x7fd29cc77030> returned a result with an error set Traceback (most recent call last): File "/home/dimpase/sagepy3/local/lib/python3.6/site- packages/sage/doctest/forker.py", line 671, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/dimpase/sagepy3/local/lib/python3.6/site- packages/sage/doctest/forker.py", line 1086, in compile_and_execute exec(compiled, globs) File "<doctest sage.libs.gap.util.NULL[5]>", line 1, in <module> libgap.eval('Complex Field with 53 bits of precision;') File "sage/libs/gap/libgap.pyx", line 410, in sage.libs.gap.libgap.Gap.eval (build/cythonized/sage/libs/gap/libgap.c:4360) elem = make_any_gap_element(self, gap_eval(gap_command)) File "sage/libs/gap/util.pyx", line 442, in sage.libs.gap.util.gap_eval (build/cythonized/sage/libs/gap/util.c:6328) raise ValueError('can only evaluate a single statement') ValueError: can only evaluate a single statement ********************************************************************** 1 item had failures: 2 of 8 in sage.libs.gap.util.NULL [21 tests, 2 failures, 1.75 s] ---------------------------------------------------------------------- sage -t --warn-long 46.7 src/sage/libs/gap/util.pyx # 2 doctests failed ---------------------------------------------------------------------- Total time for all tests: 1.8 seconds cpu time: 1.8 seconds cumulative wall time: 1.8 seconds }}} URL: https://trac.sagemath.org/26992 Reported by: dimpase Ticket author(s): Erik Bray Reviewer(s): Dima Pasechnik
- Loading branch information