Dear all, I'm encountering an annoying bug running Sage 8.8 on Linux Mint 18 Cinnamon 64-bit.
Download the attached file bug.sage, which contains only the single line
sleep(5);
and open it in a text editor; meanwhile, run Sage in a terminal from the
download directory.
In Sage, run the commands
sage: attach("bug.sage")
sage: 2+2
Then go into the text editor and resave the file without modifying it.
Immediately (within 1 second) go to the terminal and press the Up and Enter
keys to rerun the preceding command. Sage crashes with the attached message.
Best,
Evan
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-devel/ccac4db4-92a3-46df-873f-ae6a25fa7f53%40googlegroups.com.
bug.sage
Description: Binary data
***************************************************************************
IPython post-mortem report
{'commit_hash': u'033ab93c7',
'commit_source': 'installation',
'default_encoding': 'UTF-8',
'ipython_path':
'/home/evan/SageMath/local/lib/python2.7/site-packages/IPython',
'ipython_version': '5.8.0',
'os_name': 'posix',
'platform': 'Linux-4.4.0-21-generic-x86_64-with-debian-stretch-sid',
'sys_executable': '/home/evan/SageMath/local/bin/python2',
'sys_platform': 'linux2',
'sys_version': '2.7.15 (default, Jul 1 2019, 16:36:24) \n[GCC 7.2.0]'}
***************************************************************************
***************************************************************************
Crash traceback:
---------------------------------------------------------------------------
---------------------------------------------------------------------------
AttributeError Python 2.7.15: /home/evan/SageMath/local/bin/python2
Fri Apr 17 15:49:39 2020
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.
/home/evan/SageMath/src/bin/sage-ipython in <module>()
1 #!/usr/bin/env sage-python23
2 # -*- coding: utf-8 -*-
3 """
4 Sage IPython startup script.
5 """
6
7 # Display startup banner. Do this before anything else to give the user
8 # early feedback that Sage is starting.
9 from sage.misc.banner import banner
10 banner()
11
12 from sage.repl.interpreter import SageTerminalApp
13
14 app = SageTerminalApp.instance()
15 app.initialize()
---> 16 app.start()
global app.start = <bound method SageTerminalApp.start of
<sage.repl.interpreter.SageTerminalApp object at 0x7f6475348b50>>
/home/evan/SageMath/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc
in start(self=<sage.repl.interpreter.SageTerminalApp object>)
340 if self.log_level <= logging.INFO: print()
341
342 def _pylab_changed(self, name, old, new):
343 """Replace --pylab='inline' with --pylab='auto'"""
344 if new == 'inline':
345 warnings.warn("'inline' not available as pylab backend, "
346 "using 'auto' instead.")
347 self.pylab = 'auto'
348
349 def start(self):
350 if self.subapp is not None:
351 return self.subapp.start()
352 # perform any prexec steps:
353 if self.interact:
354 self.log.debug("Starting IPython's mainloop...")
--> 355 self.shell.mainloop()
self.shell.mainloop = <bound method
SageTerminalInteractiveShell.mainloop of
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f646fc088d0>>
356 else:
357 self.log.debug("IPython not interactive...")
358
359 def load_default_config(ipython_dir=None):
360 """Load the default config file from the default ipython_dir.
361
362 This is useful for embedded shells.
363 """
364 if ipython_dir is None:
365 ipython_dir = get_ipython_dir()
366
367 profile_dir = os.path.join(ipython_dir, 'profile_default')
368 app = TerminalIPythonApp()
369 app.config_file_paths.append(profile_dir)
370 app.load_config_file()
/home/evan/SageMath/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc
in mainloop(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>,
display_banner=<object object>)
480 if (not self.confirm_exit) \
481 or self.ask_yes_no('Do you really want to exit
([y]/n)?','y','n'):
482 self.ask_exit()
483
484 else:
485 if code:
486 self.run_cell(code, store_history=True)
487
488 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED):
489 # An extra layer of protection in case someone mashing Ctrl-C
breaks
490 # out of our internal code.
491 if display_banner is not DISPLAY_BANNER_DEPRECATED:
492 warn('mainloop `display_banner` argument is deprecated
since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning,
stacklevel=2)
493 while True:
494 try:
--> 495 self.interact()
self.interact = <bound method SageTerminalInteractiveShell.interact of
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f646fc088d0>>
496 break
497 except KeyboardInterrupt as e:
498 print("\n%s escaped interact()\n" % type(e).__name__)
499 finally:
500 # An interrupt during the eventloop will mess up the
501 # internal state of the prompt_toolkit library.
502 # Stopping the eventloop fixes this, see
503 # https://github.com/ipython/ipython/pull/9867
504 if hasattr(self, '_eventloop'):
505 self._eventloop.stop()
506
507 _inputhook = None
508 def inputhook(self, context):
509 if self._inputhook is not None:
510 self._inputhook(context)
/home/evan/SageMath/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc
in interact(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>,
display_banner=<object object>)
463 # Older version of prompt_toolkit; it's OK to set the
document
464 # directly here.
465 set_doc()
466 self.rl_next_input = None
467
468 def interact(self, display_banner=DISPLAY_BANNER_DEPRECATED):
469
470 if display_banner is not DISPLAY_BANNER_DEPRECATED:
471 warn('interact `display_banner` argument is deprecated
since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning,
stacklevel=2)
472
473 self.keep_running = True
474 while self.keep_running:
475 print(self.separate_in, end='')
476
477 try:
--> 478 code = self.prompt_for_code()
code = u'2+2'
self.prompt_for_code = <bound method
SageTerminalInteractiveShell.prompt_for_code of
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f646fc088d0>>
479 except EOFError:
480 if (not self.confirm_exit) \
481 or self.ask_yes_no('Do you really want to exit
([y]/n)?','y','n'):
482 self.ask_exit()
483
484 else:
485 if code:
486 self.run_cell(code, store_history=True)
487
488 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED):
489 # An extra layer of protection in case someone mashing Ctrl-C
breaks
490 # out of our internal code.
491 if display_banner is not DISPLAY_BANNER_DEPRECATED:
492 warn('mainloop `display_banner` argument is deprecated
since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning,
stacklevel=2)
493 while True:
/home/evan/SageMath/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc
in prompt_for_code(self=<sage.repl.interpreter.SageTerminalInteractiveShell
object>)
358 filter=HasFocus(DEFAULT_BUFFER) & ~IsDone() &
359 Condition(lambda cli:
self.highlight_matching_brackets))],
360 }
361
362 def _update_layout(self):
363 """
364 Ask for a re computation of the application layout, if for
example ,
365 some configuration options have changed.
366 """
367 if self._pt_app:
368 self._pt_app.layout =
create_prompt_layout(**self._layout_options())
369
370 def prompt_for_code(self):
371 document = self.pt_cli.run(
372 pre_run=self.pre_prompt, reset_current_buffer=True)
--> 373 return document.text
document.text = undefined
374
375 def enable_win_unicode_console(self):
376 if sys.version_info >= (3, 6):
377 # Since PEP 528, Python uses the unicode APIs for the
Windows
378 # console by default, so WUC shouldn't be needed.
379 return
380
381 import win_unicode_console
382
383 if PY3:
384 win_unicode_console.enable()
385 else:
386 # https://github.com/ipython/ipython/issues/9768
387 from win_unicode_console.streams import (TextStreamWrapper,
388 stdout_text_transcoded,
stderr_text_transcoded)
AttributeError: 'NoneType' object has no attribute 'text'
***************************************************************************
History of session input:get_ipython().magic(u'pinfo
sleep')attach("bug.sage")Integer(2)+Integer(2)
*** Last line of input (may not be in above history):
sage.repl.load.load(sage.repl.load.base64.b64decode("L2hvbWUvZXZhbi9idWcuc2FnZQ=="),globals(),True)
