Opened 10 years ago

Closed 10 years ago

#13859 closed defect (fixed)

Failure in gp pexpect interface when $COLUMNS is exported to Sage

Reported by: Steven Trogdon Owned by: William Stein
Priority: major Milestone: sage-5.6
Component: interfaces Keywords: gp pexpect
Cc: Merged in: sage-5.6.beta2
Authors: Steven Trogdon Reviewers: Jeroen Demeyer, Steven Trogdon
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

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

Attachments (2)

pexpect_unset_COLUMNS.patch (1.0 KB) - added by Steven Trogdon 10 years ago.
apply pexpect_unset_COLUMNS.patch
13859_comment.patch (1.0 KB) - added by Jeroen Demeyer 10 years ago.

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by Steven Trogdon

Attachment: pexpect_unset_COLUMNS.patch added

apply pexpect_unset_COLUMNS.patch

comment:1 Changed 10 years ago by Steven Trogdon

Summary: Failure in gp pexpect interface when $COLUMN is exported to SageFailure in gp pexpect interface when $COLUMNS is exported to Sage

comment:2 Changed 10 years ago by Steven Trogdon

Description: modified (diff)

comment:3 Changed 10 years ago by Steven Trogdon

Description: modified (diff)

comment:4 Changed 10 years ago by Jeroen Demeyer

Authors: Steven Trogdon
Type: PLEASE CHANGEdefect

comment:5 Changed 10 years ago by Jeroen Demeyer

Reviewers: Jeroen Demeyer
Status: newneeds_review

I assume this is ready for review? It looks good to me...

comment:6 Changed 10 years ago by Jeroen Demeyer

Status: needs_reviewpositive_review

Changed 10 years ago by Jeroen Demeyer

Attachment: 13859_comment.patch added

comment:7 Changed 10 years ago by Jeroen Demeyer

Description: modified (diff)
Status: positive_reviewneeds_work

comment:8 Changed 10 years ago by Jeroen Demeyer

Status: needs_workneeds_review

My comment patch needs review.

comment:9 Changed 10 years ago by Steven Trogdon

Reviewers: Jeroen DemeyerJeroen Demeyer, Steven Trogdon
Status: needs_reviewpositive_review

The comments are good.

comment:10 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.6.beta2
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.