#10476: Problems interrupting Singular
--------------------------+-------------------------------------------------
   Reporter:  jdemeyer    |       Owner:  was                      
       Type:  defect      |      Status:  new                      
   Priority:  major       |   Milestone:  sage-4.6.2               
  Component:  interfaces  |    Keywords:  interrupt singular expect
     Author:              |    Upstream:  N/A                      
   Reviewer:              |      Merged:                           
Work_issues:              |  
--------------------------+-------------------------------------------------

Comment(by vbraun):

 I find that it takes about 5 seconds, not "very long". On a closer look,
 it actually takes 6 seconds = 20*0.3:

 {{{
 #!python
 Definition:     singular.interrupt(self, tries=20,
 timeout=0.29999999999999999, quit_on_fail=True)
 Source:
     def interrupt(self, tries=20, timeout=0.3, quit_on_fail=True):
         E = self._expect
         if E is None:
             return True
         success = False
         try:
             for i in range(tries):
                 E.sendline(self._quit_string())
                 E.sendline(chr(3))
                 try:
                     E.expect(self._prompt, timeout=timeout)
                     success= True
                     break
                 except (pexpect.TIMEOUT, pexpect.EOF), msg:
                     #print msg
                     pass
         except Exception, msg:
             pass
         if success:
             pass
         elif quit_on_fail:
             self.quit()
         return success
 }}}

   * The inherited method `interrupt()` actually tries to quit Singular
 (`self._quit_string()=="quit"`)
   * If quitting did not work the first time, is it going to work the next
 19 times?
   * From personal experience, I find that actually interrupting (using
 ctrl-c and "continue") Singular often does not work. Restarting is very
 fast, though.

 I propose that the Singular pexpect interface override `interrupt()` to be
 a synonym for `quit()`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10476#comment:2>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to