On certain operating systems (e.g. Debian) the $COLUMNS variable is exported to the Sage shell. This variable can interfere with the gp pexpect interface when $COLUMNS > 80 as indicated by the following:
sage: dict(os.environ)["COLUMNS"]
'91'
sage -t -long -force_lib "devel/sage-main/sage/schemes/elliptic_curves/ell_number_field.py"
**********************************************************************
File "/storage/sage/sage-5.5.rc1/devel/sage-main/sage/schemes/elliptic_curves/ell_number_field.py", line 277:
sage: E.simon_two_descent()
Expected:
Traceback (most recent call last):
...
RuntimeError:
*** at top-level: ans=bnfellrank(K,[0,0,1,
*** ^--------------------
*** in function bnfellrank: ...eqtheta,rnfeq,bbnf];rang=
*** bnfell2descent_gen(b
*** ^--------------------
*** in function bnfell2descent_gen: ...riv,r=nfsqrt(nf,norm(zc))
*** [1];if(DEBUGLEVEL_el
*** ^--------------------
*** array index (1) out of allowed range [none].
An error occurred while running Simon's 2-descent program
Got:
Traceback (most recent call last):
File "/storage/sage/sage-5.5.rc1/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/storage/sage/sage-5.5.rc1/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/storage/sage/sage-5.5.rc1/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_3[17]>", line 1, in <module>
E.simon_two_descent()###line 277:
sage: E.simon_two_descent()
File "/storage/sage/sage-5.5.rc1/local/lib/python/site-packages/sage/schemes/elliptic_curves/ell_number_field.py", line 305, in simon_two_descent
maxprob=maxprob, limbigprime=limbigprime)
File "/storage/sage/sage-5.5.rc1/local/lib/python/site-packages/sage/schemes/elliptic_curves/gp_simon.py", line 102, in simon_two_descent
raise RuntimeError, "\n%s\nAn error occurred while running Simon's 2-descent program"%s
RuntimeError:
*** at top-level: ans=bnfellrank(K,[0,0,1,
*** ^--------------------
*** in function bnfellrank: ...eqtheta,rnfeq,bbnf];rang=bnfell2descent_gen(b
*** ^--------------------
*** in function bnfell2descent_gen: ...riv,r=nfsqrt(nf,norm(zc))[1];if(DEBUGLEVEL_el
*** ^--------------------
*** array index (1) out of allowed range [none].
An error occurred while running Simon's 2-descent program
**********************************************************************
and with
sage: dict(os.environ)["COLUMNS"]
'80'
sage -t -long -force_lib "devel/sage-main/sage/schemes/elliptic_curves/ell_number_field.py"
[46.1 s]
----------------------------------------------------------------------
All tests passed!
Apply pexpect_unset_COLUMNS.patch and 13859_comment.patch
apply pexpect_unset_COLUMNS.patch