*************************************************************************** IPython post-mortem report {'commit_hash': u'814d26c', 'commit_source': 'installation', 'default_encoding': 'UTF-8', 'ipython_path': '/Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython', 'ipython_version': '5.0.0', 'os_name': 'posix', 'platform': 'Darwin-15.6.0-x86_64-i386-64bit', 'sys_executable': '/Applications/sage/sage-git/local/bin/python', 'sys_platform': 'darwin', 'sys_version': '2.7.10 (default, Oct 17 2016, 19:18:40) \n[GCC 4.9.3]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- OSError Python 2.7.10: /Applications/sage/sage-git/local/bin/python Fri Oct 21 14:55:42 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. /Applications/sage/sage-git/src/bin/sage-ipython in () 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 """ 4 Sage IPython startup script. 5 """ 6 7 from sage.repl.interpreter import SageTerminalApp 8 9 app = SageTerminalApp.instance() 10 app.initialize() ---> 11 app.start() global app.start = > /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in start(self=) 333 if self.log_level <= logging.INFO: print() 334 335 def _pylab_changed(self, name, old, new): 336 """Replace --pylab='inline' with --pylab='auto'""" 337 if new == 'inline': 338 warnings.warn("'inline' not available as pylab backend, " 339 "using 'auto' instead.") 340 self.pylab = 'auto' 341 342 def start(self): 343 if self.subapp is not None: 344 return self.subapp.start() 345 # perform any prexec steps: 346 if self.interact: 347 self.log.debug("Starting IPython's mainloop...") --> 348 self.shell.mainloop() self.shell.mainloop = > 349 else: 350 self.log.debug("IPython not interactive...") 351 352 def load_default_config(ipython_dir=None): 353 """Load the default config file from the default ipython_dir. 354 355 This is useful for embedded shells. 356 """ 357 if ipython_dir is None: 358 ipython_dir = get_ipython_dir() 359 360 profile_dir = os.path.join(ipython_dir, 'profile_default') 361 362 config = Config() 363 for cf in Application._load_config_files("ipython_config", path=profile_dir): /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in mainloop(self=, display_banner=) 387 if (not self.confirm_exit) \ 388 or self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'): 389 self.ask_exit() 390 391 else: 392 if code: 393 self.run_cell(code, store_history=True) 394 395 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED): 396 # An extra layer of protection in case someone mashing Ctrl-C breaks 397 # out of our internal code. 398 if display_banner is not DISPLAY_BANNER_DEPRECATED: 399 warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) 400 while True: 401 try: --> 402 self.interact() self.interact = > 403 break 404 except KeyboardInterrupt: 405 print("\nKeyboardInterrupt escaped interact()\n") 406 407 if hasattr(self, '_eventloop'): 408 self._eventloop.close() 409 410 _inputhook = None 411 def inputhook(self, context): 412 if self._inputhook is not None: 413 self._inputhook(context) 414 415 def enable_gui(self, gui=None): 416 if gui: 417 self._inputhook = get_inputhook_func(gui) /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in interact(self=, display_banner=) 370 371 def pre_prompt(self): 372 if self.rl_next_input: 373 self.pt_cli.application.buffer.text = cast_unicode_py2(self.rl_next_input) 374 self.rl_next_input = None 375 376 def interact(self, display_banner=DISPLAY_BANNER_DEPRECATED): 377 378 if display_banner is not DISPLAY_BANNER_DEPRECATED: 379 warn('interact `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) 380 381 while self.keep_running: 382 print(self.separate_in, end='') 383 384 try: --> 385 code = self.prompt_for_code() code = u'test_conjecture_on_matrix(DBA._B)' self.prompt_for_code = > 386 except EOFError: 387 if (not self.confirm_exit) \ 388 or self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'): 389 self.ask_exit() 390 391 else: 392 if code: 393 self.run_cell(code, store_history=True) 394 395 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED): 396 # An extra layer of protection in case someone mashing Ctrl-C breaks 397 # out of our internal code. 398 if display_banner is not DISPLAY_BANNER_DEPRECATED: 399 warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) 400 while True: /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in prompt_for_code(self=) 306 processor=HighlightMatchingBracketProcessor(chars='[](){}'), 307 filter=HasFocus(DEFAULT_BUFFER) & ~IsDone() & 308 Condition(lambda cli: self.highlight_matching_brackets))], 309 } 310 311 def _update_layout(self): 312 """ 313 Ask for a re computation of the application layout, if for example , 314 some configuration options have changed. 315 """ 316 if self._pt_app: 317 self._pt_app.layout = create_prompt_layout(**self._layout_options()) 318 319 def prompt_for_code(self): 320 document = self.pt_cli.run( --> 321 pre_run=self.pre_prompt, reset_current_buffer=True) global pre_run = undefined self.pre_prompt = > global reset_current_buffer = undefined global True = undefined 322 return document.text 323 324 def init_io(self): 325 if sys.platform not in {'win32', 'cli'}: 326 return 327 328 import win_unicode_console 329 import colorama 330 331 win_unicode_console.enable() 332 colorama.init() 333 334 # For some reason we make these wrappers around stdout/stderr. 335 # For now, we need to reset them so all output gets coloured. 336 # https://github.com/ipython/ipython/issues/8669 /Applications/sage/sage-git/local/lib/python2.7/site-packages/prompt_toolkit/interface.pyc in run(self=, reset_current_buffer=True, pre_run=>) 374 try: 375 self._is_running = True 376 377 self.on_start.fire() 378 self.reset(reset_current_buffer=reset_current_buffer) 379 380 # Call pre_run. 381 if pre_run: 382 pre_run() 383 384 # Run eventloop in raw mode. 385 with self.input.raw_mode(): 386 self.renderer.request_absolute_cursor_position() 387 self._redraw() 388 --> 389 self.eventloop.run(self.input, self.create_eventloop_callbacks()) self.eventloop.run = > self.input = StdinInput(stdin=', mode 'r' at 0x10156e0c0>) self.create_eventloop_callbacks = > 390 finally: 391 # Clean up renderer. (This will leave the alternate screen, if we use 392 # that.) 393 394 # If exit/abort haven't been called set, but another exception was 395 # thrown instead for some reason, make sure that we redraw in exit 396 # mode. 397 if not self.is_done: 398 self._exit_flag = True 399 self._redraw() 400 401 self.renderer.reset() 402 self.on_stop.fire() 403 self._is_running = False 404 /Applications/sage/sage-git/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/posix.pyc in run(self=, stdin=StdinInput(stdin=', mode 'r' at 0x10156e0c0>), callbacks=) 87 # Quit when the input stream was closed. 88 if stdin_reader.closed: 89 self.stop() 90 91 self.add_reader(stdin, read_from_stdin) 92 self.add_reader(self._schedule_pipe[0], None) 93 94 with ctx: 95 while self._running: 96 # Call inputhook. 97 with TimeIt() as inputhook_timer: 98 if self._inputhook_context: 99 def ready(wait): 100 " True when there is input ready. The inputhook should return control. " 101 return self._ready_for_reading(current_timeout[0] if wait else 0) != [] --> 102 self._inputhook_context.call_inputhook(ready) self._inputhook_context.call_inputhook = > ready = 103 104 # Calculate remaining timeout. (The inputhook consumed some of the time.) 105 if current_timeout[0] is None: 106 remaining_timeout = None 107 else: 108 remaining_timeout = max(0, current_timeout[0] - inputhook_timer.duration) 109 110 # Wait until input is ready. 111 fds = self._ready_for_reading(remaining_timeout) 112 113 # When any of the FDs are ready. Call the appropriate callback. 114 if fds: 115 # Create lists of high/low priority tasks. The main reason 116 # for this is to allow painting the UI to happen as soon as 117 # possible, but when there are many events happening, we /Applications/sage/sage-git/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/inputhook.pyc in call_inputhook(self=, input_is_ready_func=) 57 58 def call_inputhook(self, input_is_ready_func): 59 """ 60 Call the inputhook. (Called by a prompt-toolkit eventloop.) 61 """ 62 self._input_is_ready = input_is_ready_func 63 64 # Start thread that activates this pipe when there is input to process. 65 def thread(): 66 input_is_ready_func(wait=True) 67 os.write(self._w, b'x') 68 69 threading.Thread(target=thread).start() 70 71 # Call inputhook. ---> 72 self.inputhook(self) self.inputhook = > self = 73 74 # Flush the read end of the pipe. 75 try: 76 os.read(self._r, 1024) 77 except OSError: 78 # This happens when the window resizes and a SIGWINCH was received. 79 # We get 'Error: [Errno 4] Interrupted system call' 80 # Just ignore. 81 pass 82 self._input_is_ready = None 83 84 def close(self): 85 """ 86 Clean up resources. 87 """ /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in inputhook(self=, context=) 398 if display_banner is not DISPLAY_BANNER_DEPRECATED: 399 warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) 400 while True: 401 try: 402 self.interact() 403 break 404 except KeyboardInterrupt: 405 print("\nKeyboardInterrupt escaped interact()\n") 406 407 if hasattr(self, '_eventloop'): 408 self._eventloop.close() 409 410 _inputhook = None 411 def inputhook(self, context): 412 if self._inputhook is not None: --> 413 self._inputhook(context) self._inputhook = context = 414 415 def enable_gui(self, gui=None): 416 if gui: 417 self._inputhook = get_inputhook_func(gui) 418 else: 419 self._inputhook = None 420 421 # Run !system commands directly, not through pipes, so terminal programs 422 # work correctly. 423 system = InteractiveShell.system_raw 424 425 def auto_rewrite_input(self, cmd): 426 """Overridden from the parent class to use fancy rewriting prompt""" 427 if not self.show_rewritten_input: 428 return /Applications/sage/sage-git/local/lib/python2.7/site-packages/sage/repl/inputhook.pyc in sage_inputhook(context=) 19 import select 20 import errno 21 22 from IPython import get_ipython 23 from IPython.terminal.pt_inputhooks import register 24 25 import sage.repl.attach 26 27 28 TIMEOUT = 0.25 # seconds 29 30 31 def sage_inputhook(context): 32 f = context.fileno() 33 while True: ---> 34 sage.repl.attach.reload_attached_files_if_modified() global sage.repl.attach.reload_attached_files_if_modified = 35 try: 36 r, w, e = select.select([f], [], [], TIMEOUT) 37 if f in r: 38 return # IPython signalled us to stop 39 except select.error as e: 40 if e[0] != errno.EINTR: 41 raise 42 43 44 register('sage', sage_inputhook) 45 46 47 def install(): 48 """ 49 Install the Sage input hook /Applications/sage/sage-git/local/lib/python2.7/site-packages/sage/repl/attach.pyc in reload_attached_files_if_modified() 572 where the automatic reload is triggered. So we have to do it 573 manually:: 574 575 sage: shell.run_cell('from sage.repl.attach import reload_attached_files_if_modified') 576 sage: shell.run_cell('reload_attached_files_if_modified()') 577 ### reloading attached file tmp_....py modified at ... ### 578 579 sage: shell.run_cell('a') 580 3 581 sage: shell.run_cell('detach({0})'.format(repr(tmp))) 582 sage: shell.run_cell('attached_files()') 583 [] 584 sage: shell.quit() 585 """ 586 ip = get_ipython() --> 587 for filename, mtime in modified_file_iterator(): filename = undefined mtime = undefined global modified_file_iterator = 588 basename = os.path.basename(filename) 589 timestr = time.strftime('%T', mtime) 590 notice = '### reloading attached file {0} modified at {1} ###'.format(basename, timestr) 591 if ip and ip.pt_cli: 592 with ip.pt_cli.patch_stdout_context(): 593 print(notice) 594 code = load_wrap(filename, attach=True) 595 ip.run_cell(code) 596 elif ip: 597 print(notice) 598 code = load_wrap(filename, attach=True) 599 ip.run_cell(code) 600 else: 601 print(notice) 602 load(filename, globals(), attach=True) /Applications/sage/sage-git/local/lib/python2.7/site-packages/sage/repl/attach.pyc in modified_file_iterator() 520 sage: list(modified_file_iterator()) 521 [] 522 sage: sleep(1) # filesystem mtime granularity 523 sage: open(t, 'w').write('1') 524 sage: list(modified_file_iterator()) 525 [('/.../tmp_....py', time.struct_time(...))] 526 """ 527 global attached 528 modified = dict() 529 for filename in attached.keys(): 530 old_tm = attached[filename] 531 if not os.path.exists(filename): 532 print('### detaching file {0} because it does not exist (deleted?) ###'.format(filename)) 533 detach(filename) 534 continue --> 535 new_tm = os.path.getmtime(filename) new_tm = undefined global os.path.getmtime = filename = '/Users/dylanrupel/.sage/level_zero/double_bruhat_algebra.py' 536 if new_tm > old_tm: 537 modified[filename] = new_tm 538 539 if not modified: 540 return 541 time.sleep(0.1) # sleep 100ms to give the editor time to finish saving 542 543 for filename in modified.keys(): 544 old_tm = modified[filename] 545 new_tm = os.path.getmtime(filename) 546 if new_tm == old_tm: 547 # file was modified but did not change in the last 100ms 548 attached[filename] = new_tm 549 yield filename, time.gmtime(new_tm) 550 /Applications/sage/sage-git/local/lib/python/genericpath.pyc in getmtime(filename='/Users/dylanrupel/.sage/level_zero/double_bruhat_algebra.py') 47 """Return true if the pathname refers to an existing directory.""" 48 try: 49 st = os.stat(s) 50 except os.error: 51 return False 52 return stat.S_ISDIR(st.st_mode) 53 54 55 def getsize(filename): 56 """Return the size of a file, reported by os.stat().""" 57 return os.stat(filename).st_size 58 59 60 def getmtime(filename): 61 """Return the last modification time of a file, reported by os.stat().""" ---> 62 return os.stat(filename).st_mtime global os.stat = filename.st_mtime = undefined 63 64 65 def getatime(filename): 66 """Return the last access time of a file, reported by os.stat().""" 67 return os.stat(filename).st_atime 68 69 70 def getctime(filename): 71 """Return the metadata change time of a file, reported by os.stat().""" 72 return os.stat(filename).st_ctime 73 74 75 # Return the longest prefix of all list elements. 76 def commonprefix(m): 77 "Given a list of pathnames, returns the longest common leading component" OSError: [Errno 2] No such file or directory: '/Users/dylanrupel/.sage/level_zero/double_bruhat_algebra.py' *************************************************************************** History of session input:DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])get_ipython().magic(u'attach double_bruhat_algebra.py')DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)(Integer(0), Integer(0), -Integer(1), Integer(2), Integer(0))La = DBA._RS.weight_space(extended = True).basis()wt = -La[Integer(2)]+Integer(2)*La[Integer(3)]DBA.path_graph(wt)test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)type((Integer(1),Integer(2)))type((Integer(1),Integer(2))) == 'tuple'type((Integer(1),Integer(2))) == isinstance((Integer(1),Integer(2)), tuple)type((Integer(1),Integer(2))) == tupletype((Integer(1),Integer(2)))((Integer(3),Integer(2),-Integer(5)))type((Integer(1),Integer(2)))([Integer(3),Integer(2),-Integer(5)])type(_)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)test_conjecture_on_matrix(DBA._B)wt = La[Integer(1)]-Integer(2)*La[Integer(2)]+Integer(2)*La[Integer(3)]V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(7))DBA.path_graph(wt)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(3))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])W = V.subcrystal(max_depth=Integer(5))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])W = V.subcrystal(max_depth=Integer(7))W = V.subcrystal(max_depth=Integer(6))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])exp(Integer(2))exp(matrix([[Integer(0),Integer(1),Integer(0)],[Integer(0),Integer(0),Integer(2)],[Integer(0),Integer(0),Integer(0)]]))exp(matrix([[Integer(0),Integer(0),Integer(0)],[Integer(1),Integer(0),Integer(0)],[Integer(0),Integer(2),Integer(0)]]))wt = La[Integer(1)]-Integer(2)*La[Integer(2)]+Integer(2)*La[Integer(3)]DBA = DoubleBruhatAlgebra(['C',Integer(2),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(3),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(5),Integer(1)])DBA = DoubleBruhatAlgebra(['C',Integer(5)])DBA = DoubleBruhatAlgebra(['C',Integer(5)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(5)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(5)])test_conjecture_on_matrix(DBA._B)exp(matrix([[Integer(0),Integer(1),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(2),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(3)],[Integer(0),Integer(0),Integer(0),Integer(0)]]))exp(matrix([[Integer(0),Integer(1),Integer(0),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(2),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(3),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(0),Integer(4)],[Integer(0),Integer(0),Integer(0),Integer(0),Integer(0)]]))DBA = DoubleBruhatAlgebra(['C',Integer(3)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(4)])test_conjecture_on_matrix(DBA._B)DBA.path_graph((Integer(0), Integer(1), -Integer(2), Integer(1)))La = DBA._RS.weight_space().basis()wt = La[Integer(1)]-Integer(2)*La[Integer(2)]+La[Integer(3)]V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(6))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])W = V.subcrystal(max_depth=Integer(20))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])DBA.path_graph((Integer(0), Integer(1), -Integer(2), Integer(1)))G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[DBA._crystal_weight_dict[W.module_generators[Integer(0)].weight()][W.module_generators[Integer(0)].weight()]])DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B)La = DBA._RS.weight_space().basis()wt = -Integer(2)*La[Integer(0)]+Integer(3)*La[Integer(1)]V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(20))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[DBA._crystal_weight_dict[W.module_generators[Integer(0)].weight()][W.module_generators[Integer(0)].weight()]])G.path_graph((-Integer(2),Integer(3)))DBA.path_graph((-Integer(2),Integer(3)))G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B) *** Last line of input (may not be in above history): test_conjecture_on_matrix(DBA._B)