*************************************************************************** IPython post-mortem report {'commit_hash': u'f76401f', 'commit_source': 'installation', 'default_encoding': 'UTF-8', 'ipython_path': '/opt/sage/local/lib/python2.7/site-packages/IPython', 'ipython_version': '4.1.2', 'os_name': 'posix', 'platform': 'Linux-4.4.0-34-generic-x86_64-with-debian-jessie-sid', 'sys_executable': '/opt/sage/local/bin/python', 'sys_platform': 'linux2', 'sys_version': '2.7.10 (default, May 16 2016, 05:06:16) \n[GCC 4.9.3]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- IndexError Python 2.7.10: /opt/sage/local/bin/python Mon Aug 29 09:42:41 2016 A problem occurred executing Python code. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last. /opt/sage/src/bin/sage-ipython in () 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 """ 4 Sage IPython startup script. 5 """ 6 7 # Install extra readline commands before IPython initialization 8 from sage.repl.readline_extra_commands import * 9 10 from sage.repl.interpreter import SageTerminalApp 11 12 app = SageTerminalApp.instance() 13 app.initialize() ---> 14 app.start() global app.start = > /opt/sage/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in start(self=) 330 if self.log_level <= logging.INFO: print() 331 332 def _pylab_changed(self, name, old, new): 333 """Replace --pylab='inline' with --pylab='auto'""" 334 if new == 'inline': 335 warn.warn("'inline' not available as pylab backend, " 336 "using 'auto' instead.") 337 self.pylab = 'auto' 338 339 def start(self): 340 if self.subapp is not None: 341 return self.subapp.start() 342 # perform any prexec steps: 343 if self.interact: 344 self.log.debug("Starting IPython's mainloop...") --> 345 self.shell.mainloop() self.shell.mainloop = > 346 else: 347 self.log.debug("IPython not interactive...") 348 349 def load_default_config(ipython_dir=None): 350 """Load the default config file from the default ipython_dir. 351 352 This is useful for embedded shells. 353 """ 354 if ipython_dir is None: 355 ipython_dir = get_ipython_dir() 356 357 profile_dir = os.path.join(ipython_dir, 'profile_default') 358 359 config = Config() 360 for cf in Application._load_config_files("ipython_config", path=profile_dir): /opt/sage/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in mainloop(self=, display_banner=None) 533 #------------------------------------------------------------------------- 534 # Mainloop and code execution logic 535 #------------------------------------------------------------------------- 536 537 def mainloop(self, display_banner=None): 538 """Start the mainloop. 539 540 If an optional banner argument is given, it will override the 541 internally created default banner. 542 """ 543 544 with self.builtin_trap, self.display_trap: 545 546 while 1: 547 try: --> 548 self.interact(display_banner=display_banner) self.interact = > display_banner = None 549 #self.interact_with_readline() 550 # XXX for testing of a readline-decoupled repl loop, call 551 # interact_with_readline above 552 break 553 except KeyboardInterrupt: 554 # this should not be necessary, but KeyboardInterrupt 555 # handling seems rather unpredictable... 556 self.write("\nKeyboardInterrupt in interact()\n") 557 558 def _replace_rlhist_multiline(self, source_raw, hlen_before_cell): 559 """Store multiple lines as a single entry in history""" 560 561 # do nothing without readline or disabled multiline 562 if not self.has_readline or not self.multiline_history: 563 return hlen_before_cell /opt/sage/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in interact(self=, display_banner=False) 643 except EOFError: 644 if self.autoindent: 645 self.rl_do_indent = False 646 if self.has_readline: 647 self.readline_startup_hook(None) 648 self.write('\n') 649 self.exit() 650 except bdb.BdbQuit: 651 warn('The Python debugger has exited with a BdbQuit exception.\n' 652 'Because of how pdb handles the stack, it is impossible\n' 653 'for IPython to properly format this particular exception.\n' 654 'IPython will resume normal operation.') 655 except: 656 # exceptions here are VERY RARE, but they can be triggered 657 # asynchronously by signal handlers, for example. --> 658 self.showtraceback() self.showtraceback = > 659 else: 660 try: 661 self.input_splitter.push(line) 662 more = self.input_splitter.push_accepts_more() 663 except SyntaxError: 664 # Run the code directly - run_cell takes care of displaying 665 # the exception. 666 more = False 667 if (self.SyntaxTB.last_syntax_error and 668 self.autoedit_syntax): 669 self.edit_syntax_error() 670 if not more: 671 source_raw = self.input_splitter.raw_reset() 672 self.run_cell(source_raw, store_history=True) 673 hlen_b4_cell = \ /opt/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in showtraceback(self=, exc_tuple=None, filename=None, tb_offset=None, exception_only=False) 1815 self.show_usage_error(value) 1816 else: 1817 if exception_only: 1818 stb = ['An exception has occurred, use %tb to see ' 1819 'the full traceback.\n'] 1820 stb.extend(self.InteractiveTB.get_exception_only(etype, 1821 value)) 1822 else: 1823 try: 1824 # Exception classes can customise their traceback - we 1825 # use this in IPython.parallel for exceptions occurring 1826 # in the engines. This should return a list of strings. 1827 stb = value._render_traceback_() 1828 except Exception: 1829 stb = self.InteractiveTB.structured_traceback(etype, -> 1830 value, tb, tb_offset=tb_offset) value = TimeoutException() tb = tb_offset = None 1831 1832 self._showtraceback(etype, value, stb) 1833 if self.call_pdb: 1834 # drop into debugger 1835 self.debugger(force=True) 1836 return 1837 1838 # Actually show the traceback 1839 self._showtraceback(etype, value, stb) 1840 1841 except KeyboardInterrupt: 1842 self.write_err('\n' + self.get_exception_only()) 1843 1844 def _showtraceback(self, etype, evalue, stb): 1845 """Actually show a traceback. /opt/sage/local/lib/python2.7/site-packages/IPython/core/ultratb.pyc in structured_traceback(self=, etype=, value=TimeoutException(), tb=, tb_offset=None, number_of_lines_of_context=5) 1377 out.write('\n') 1378 out.flush() 1379 # FIXME: we should remove the auto pdb behavior from here and leave 1380 # that to the clients. 1381 try: 1382 self.debugger() 1383 except KeyboardInterrupt: 1384 print("\nKeyboardInterrupt") 1385 1386 def structured_traceback(self, etype=None, value=None, tb=None, 1387 tb_offset=None, number_of_lines_of_context=5): 1388 if etype is None: 1389 etype, value, tb = sys.exc_info() 1390 self.tb = tb 1391 return FormattedTB.structured_traceback( -> 1392 self, etype, value, tb, tb_offset, number_of_lines_of_context) self = etype = value = TimeoutException() tb = tb_offset = None number_of_lines_of_context = 5 1393 1394 1395 #--------------------------------------------------------------------------- 1396 1397 # A simple class to preserve Nathan's original functionality. 1398 class ColorTB(FormattedTB): 1399 """Shorthand to initialize a FormattedTB in Linux colors mode.""" 1400 1401 def __init__(self, color_scheme='Linux', call_pdb=0, **kwargs): 1402 FormattedTB.__init__(self, color_scheme=color_scheme, 1403 call_pdb=call_pdb, **kwargs) 1404 1405 1406 class SyntaxTB(ListTB): 1407 """Extension which holds some state: the last exception value""" /opt/sage/local/lib/python2.7/site-packages/IPython/core/ultratb.pyc in structured_traceback(self=, etype=, value=TimeoutException(), tb=, tb_offset=1, number_of_lines_of_context=5) 1285 # set_mode also sets the tb_join_char attribute 1286 self.set_mode(mode) 1287 1288 def _extract_tb(self, tb): 1289 if tb: 1290 return traceback.extract_tb(tb) 1291 else: 1292 return None 1293 1294 def structured_traceback(self, etype, value, tb, tb_offset=None, number_of_lines_of_context=5): 1295 tb_offset = self.tb_offset if tb_offset is None else tb_offset 1296 mode = self.mode 1297 if mode in self.verbose_modes: 1298 # Verbose modes need a full traceback 1299 return VerboseTB.structured_traceback( -> 1300 self, etype, value, tb, tb_offset, number_of_lines_of_context self = etype = value = TimeoutException() tb = tb_offset = 1 number_of_lines_of_context = 5 1301 ) 1302 else: 1303 # We must check the source cache because otherwise we can print 1304 # out-of-date source code. 1305 self.check_cache() 1306 # Now we can extract and format the exception 1307 elist = self._extract_tb(tb) 1308 return ListTB.structured_traceback( 1309 self, etype, value, elist, tb_offset, number_of_lines_of_context 1310 ) 1311 1312 def stb2text(self, stb): 1313 """Convert a structured traceback (a list) to a string.""" 1314 return self.tb_join_char.join(stb) 1315 /opt/sage/local/lib/python2.7/site-packages/IPython/core/ultratb.pyc in structured_traceback(self=, etype=, evalue=TimeoutException(), etb=, tb_offset=1, number_of_lines_of_context=5) 1169 chained_exceptions_tb_offset) 1170 exception = self.get_parts_of_chained_exception(evalue) 1171 1172 if exception and not id(exception[1]) in chained_exc_ids: 1173 chained_exc_ids.add(id(exception[1])) # trace exception to avoid infinite 'cause' loop 1174 formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__) 1175 etype, evalue, etb = exception 1176 else: 1177 evalue = None 1178 1179 # we want to see exceptions in a reversed order: 1180 # the first exception should be on top 1181 for formatted_exception in reversed(formatted_exceptions): 1182 structured_traceback_parts += formatted_exception 1183 else: -> 1184 structured_traceback_parts += formatted_exception[0] structured_traceback_parts = [u'\x1b[0;31m---------------------------------------------------------------------------\x1b[0m'] formatted_exception = u'' 1185 1186 return structured_traceback_parts 1187 1188 def debugger(self, force=False): 1189 """Call up the pdb debugger if desired, always clean up the tb 1190 reference. 1191 1192 Keywords: 1193 1194 - force(False): by default, this routine checks the instance call_pdb 1195 flag and does not actually invoke the debugger if the flag is false. 1196 The 'force' option forces the debugger to activate even if the flag 1197 is false. 1198 1199 If the call_pdb flag is set, the pdb interactive debugger is IndexError: string index out of range *************************************************************************** History of session input:get_ipython().magic(u'cd sage/sfiles/ectp')from __future__ import divisionget_ipython().magic(u'attach cellnegerator.sage')runsim()runsim()runsim()runsim()runsim()runsim()runsim()signal.alarm(Integer(5))signal.alarm(Integer(5))signal.alarm(Integer(5))signal.alarm(Integer(5))runsim()runsim() *** Last line of input (may not be in above history): runsim()