#14523: can't exit or detach after error in attached file
----------------------------------+-----------------------------------------
       Reporter:  mstreng         |         Owner:  was             
           Type:  defect          |        Status:  needs_work      
       Priority:  major           |     Milestone:  sage-5.11       
      Component:  user interface  |    Resolution:                  
       Keywords:                  |   Work issues:                  
Report Upstream:  N/A             |     Reviewers:  Travis Scrimshaw
        Authors:  Volker Braun    |     Merged in:                  
   Dependencies:  #14266          |      Stopgaps:                  
----------------------------------+-----------------------------------------

Old description:

> {{{
> 17:57:03:~$ touch myfile.sage
> 17:57:05:~$ sage
> ----------------------------------------------------------------------
> | Sage Version 5.8, Release Date: 2013-03-15                         |
> | Type "notebook()" for the browser-based notebook interface.        |
> | Type "help()" for help.                                            |
> ----------------------------------------------------------------------
> sage: %attach myfile.sage
> sage: file('myfile.sage', 'w').write('1/0')
> sage: 1+1
> ...
> ZeroDivisionError: Rational division by zero
> sage: exit
> ...
> ZeroDivisionError: Rational division by zero
> sage: detach('myfile.sage')
> ...
> ZeroDivisionError: Rational division by zero
> }}}
>
> It seems like the only way to continue using this Sage session is to fix
> the error first. But suppose you have some reason not to (e.g. are in a
> hurry, and the error is hard to fix). I think it would be much better if
> Sage was to evaluate "1+1" and especially "exit" and "detach" even when
> unable to reload one of the attached files.
>
> Possible ways to fix this are discussed on
> [http://groups.google.com/forum/?fromgroups=#!topic/sage-
> devel/FM7EAAmJhuk sage-devel].

New description:

 {{{
 17:57:03:~$ touch myfile.sage
 17:57:05:~$ sage
 ----------------------------------------------------------------------
 | Sage Version 5.8, Release Date: 2013-03-15                         |
 | Type "notebook()" for the browser-based notebook interface.        |
 | Type "help()" for help.                                            |
 ----------------------------------------------------------------------
 sage: %attach myfile.sage
 sage: file('myfile.sage', 'w').write('1/0')
 sage: 1+1
 ...
 ZeroDivisionError: Rational division by zero
 sage: exit
 ...
 ZeroDivisionError: Rational division by zero
 sage: detach('myfile.sage')
 ...
 ZeroDivisionError: Rational division by zero
 }}}

 It seems like the only way to continue using this Sage session is to fix
 the error first. But suppose you have some reason not to (e.g. are in a
 hurry, and the error is hard to fix). I think it would be much better if
 Sage was to evaluate "1+1" and especially "exit" and "detach" even when
 unable to reload one of the attached files.

 Possible ways to fix this are discussed on
 [http://groups.google.com/forum/?fromgroups=#!topic/sage-devel/FM7EAAmJhuk
 sage-devel].

 Apply
 * [attachment:trac_14523_improve_attach.patch]
 * [attachment:trac_14523_readline.patch]

--

Comment (by vbraun):

 All subsequent changes will be in the separate
 `trac_14523_readline.patch`. This does now sidesteps IPython to preserve
 our signal handlers. Also, it really needs to be implemented in Cython
 since the inputhook must be able to ignore signals so it does not get
 interrupted immediately when you press Ctrl-C at the prompt.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14523#comment:28>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to