--
You received this message because you are subscribed to the Google Groups
"sage-support" 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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.
***************************************************************************
IPython post-mortem report
{'commit_hash': u'f76401f',
'commit_source': 'installation',
'default_encoding': 'UTF-8',
'ipython_path': '/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython',
'ipython_version': '4.1.2',
'os_name': 'posix',
'platform': 'Linux-3.19.0-32-generic-x86_64-with-debian-jessie-sid',
'sys_executable': '/usr/lib/sagemath/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:
---------------------------------------------------------------------------
---------------------------------------------------------------------------
AttributeError Python 2.7.10: /usr/lib/sagemath/local/bin/python
Tue Jan 3 21:22:05 2017
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.
/usr/lib/sagemath/local/bin/sage-ipython in <module>()
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()
global app.initialize = <bound method SageTerminalApp.initialize of
<sage.repl.interpreter.SageTerminalApp object at 0x7f73525c1310>>
14 app.start()
<decorator-gen-111> in initialize(self=<sage.repl.interpreter.SageTerminalApp
object>, argv=None)
/usr/lib/sagemath/local/lib/python2.7/site-packages/traitlets/config/application.pyc
in catch_config_error(method=<function initialize>,
app=<sage.repl.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={})
59
60
#-----------------------------------------------------------------------------
61 # Application class
62
#-----------------------------------------------------------------------------
63
64 @decorator
65 def catch_config_error(method, app, *args, **kwargs):
66 """Method decorator for catching invalid config
(Trait/ArgumentErrors) during init.
67
68 On a TraitError (generally caused by bad config), this will print
the trait's
69 message, and exit the app.
70
71 For use on init methods, to prevent invoking excepthook on invalid
input.
72 """
73 try:
---> 74 return method(app, *args, **kwargs)
method = <function initialize at 0x7f734c8341b8>
app = <sage.repl.interpreter.SageTerminalApp object at 0x7f73525c1310>
args = (None,)
kwargs = {}
75 except (TraitError, ArgumentError) as e:
76 app.print_help()
77 app.log.fatal("Bad config encountered during initialization:")
78 app.log.fatal(str(e))
79 app.log.debug("Config at the time: %s", app.config)
80 app.exit(1)
81
82
83 class ApplicationError(Exception):
84 pass
85
86
87 class LevelFormatter(logging.Formatter):
88 """Formatter with additional `highlevel` record
89
/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc
in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)
291
292 return super(TerminalIPythonApp, self).parse_command_line(argv)
293
294 @catch_config_error
295 def initialize(self, argv=None):
296 """Do actions after construct, but before starting the app."""
297 super(TerminalIPythonApp, self).initialize(argv)
298 if self.subapp is not None:
299 # don't bother initializing further, starting subapp
300 return
301 # print self.extra_args
302 if self.extra_args and not self.something_to_run:
303 self.file_to_run = self.extra_args[0]
304 self.init_path()
305 # create the shell
--> 306 self.init_shell()
self.init_shell = <bound method SageTerminalApp.init_shell of
<sage.repl.interpreter.SageTerminalApp object at 0x7f73525c1310>>
307 # and draw the banner
308 self.init_banner()
309 # Now a variety of things that happen after the banner is
printed.
310 self.init_gui_pylab()
311 self.init_extensions()
312 self.init_code()
313
314 def init_shell(self):
315 """initialize the InteractiveShell instance"""
316 # Create an InteractiveShell instance.
317 # shell.display_banner should always be False for the terminal
318 # based app, because we call shell.show_banner() by hand below
319 # so the banner shows *before* all extension loading stuff.
320 self.shell = TerminalInteractiveShell.instance(parent=self,
321 display_banner=False,
profile_dir=self.profile_dir,
/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/repl/interpreter.pyc
in init_shell(self=<sage.repl.interpreter.SageTerminalApp object>)
776 :meth:`TerminalIPythonApp.init_shell`.
777
778 EXAMPLES::
779
780 sage: from sage.repl.interpreter import SageTerminalApp,
DEFAULT_SAGE_CONFIG
781 sage: app = SageTerminalApp.instance()
782 sage: app.shell
783 <sage.repl.interpreter.SageTestShell object at 0x...>
784 """
785 # Shell initialization
786 self.shell = self.shell_class.instance(
787 parent=self,
788 config=self.config,
789 display_banner=False,
790 profile_dir=self.profile_dir,
--> 791 ipython_dir=self.ipython_dir)
global ipython_dir = undefined
self.ipython_dir = u'/home/anubhab/.sage/ipython-4.1.2'
792 self.shell.configurables.append(self)
793 self.shell.has_sage_extensions = SAGE_EXTENSION in
self.extensions
794
795 # Load the %lprun extension if available
796 try:
797 import line_profiler
798 except ImportError:
799 pass
800 else:
801 self.extensions.append('line_profiler')
802
803 if self.shell.has_sage_extensions:
804 self.extensions.remove(SAGE_EXTENSION)
805
806 # load sage extension here to get a crash if
/usr/lib/sagemath/local/lib/python2.7/site-packages/traitlets/config/configurable.pyc
in instance(cls=<class 'sage.repl.interpreter.SageTerminalInteractiveShell'>,
*args=(), **kwargs={'config': {'SageTerminalApp': {'force_interact': True},
'I...lse, 'test_shell': False, 'verbose_crash': True}}, 'display_banner':
False, 'ipython_dir': u'/home/anubhab/.sage/ipython-4.1.2', 'parent':
<sage.repl.interpreter.SageTerminalApp object>, 'profile_dir':
<IPython.core.profiledir.ProfileDir object>})
390 >>> class Foo(SingletonConfigurable): pass
391 >>> foo = Foo.instance()
392 >>> foo == Foo.instance()
393 True
394
395 Create a subclass that is retrived using the base class
instance::
396
397 >>> class Bar(SingletonConfigurable): pass
398 >>> class Bam(Bar): pass
399 >>> bam = Bam.instance()
400 >>> bam == Bar.instance()
401 True
402 """
403 # Create and save the instance
404 if cls._instance is None:
--> 405 inst = cls(*args, **kwargs)
inst = undefined
cls = <class 'sage.repl.interpreter.SageTerminalInteractiveShell'>
args = ()
kwargs = {'ipython_dir': u'/home/anubhab/.sage/ipython-4.1.2',
'display_banner': False, 'config': {'SageTerminalApp': {'force_interact':
True}, 'InteractiveShell': {'separate_in': '', 'ast_node_interactivity': 'all',
'colors': 'LightBG', 'confirm_exit': False}, 'InteractiveShellApp':
{'extensions': ['sage']}, 'PromptManager': {'out_template': '', 'in2_template':
'....: ', 'in_template': 'sage: ', 'justify': False}, 'TerminalIPythonApp':
{'shell_class': <class 'sage.repl.interpreter.SageTerminalInteractiveShell'>,
'display_banner': False, 'test_shell': False, 'verbose_crash': True}},
'profile_dir': <IPython.core.profiledir.ProfileDir object at 0x7f734c860910>,
'parent': <sage.repl.interpreter.SageTerminalApp object at 0x7f73525c1310>}
406 # Now make sure that the instance will also be returned by
407 # parent classes' _instance attribute.
408 for subclass in cls._walk_mro():
409 subclass._instance = inst
410
411 if isinstance(cls._instance, cls):
412 return cls._instance
413 else:
414 raise MultipleInstanceError(
415 'Multiple incompatible subclass instances of '
416 '%s are being created.' % cls.__name__
417 )
418
419 @classmethod
420 def initialized(cls):
/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
in __init__(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>,
ipython_dir=u'/home/anubhab/.sage/ipython-4.1.2',
profile_dir=<IPython.core.profiledir.ProfileDir object>, user_module=None,
user_ns=None, custom_exceptions=((), None), **kwargs={'config':
{'SageTerminalApp': {'force_interact': True}, 'I...lse, 'test_shell': False,
'verbose_crash': True}}, 'display_banner': False, 'parent':
<sage.repl.interpreter.SageTerminalApp object>})
450 self.init_create_namespaces(user_module, user_ns)
451 # This has to be done after init_create_namespaces because it
uses
452 # something in self.user_ns, but before init_sys_modules, which
453 # is the first thing to modify sys.
454 # TODO: When we override sys.stdout and sys.stderr before this
class
455 # is created, we are saving the overridden ones here. Not sure
if this
456 # is what we want to do.
457 self.save_sys_module_state()
458 self.init_sys_modules()
459
460 # While we're trying to have each part of the code directly
access what
461 # it needs without keeping redundant references to objects, we
have too
462 # much legacy code that expects ip.db to exist.
463 self.db = PickleShareDB(os.path.join(self.profile_dir.location,
'db'))
464
--> 465 self.init_history()
self.init_history = <bound method
SageTerminalInteractiveShell.init_history of
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f734c8609d0>>
466 self.init_encoding()
467 self.init_prefilter()
468
469 self.init_syntax_highlighting()
470 self.init_hooks()
471 self.init_events()
472 self.init_pushd_popd_magic()
473 # self.init_traceback_handlers use to be here, but we moved it
below
474 # because it and init_io have to come after init_readline.
475 self.init_user_ns()
476 self.init_logger()
477 self.init_builtins()
478
479 # The following was in post_config_initialization
480 self.init_inspector()
/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
in init_history(self=<sage.repl.interpreter.SageTerminalInteractiveShell
object>)
1571 with self.builtin_trap:
1572 info = self._object_find(oname)
1573 if info.found:
1574 return self.inspector._format_info(info.obj, oname,
info=info,
1575 detail_level=detail_level
1576 )
1577 else:
1578 raise KeyError(oname)
1579
1580
#-------------------------------------------------------------------------
1581 # Things related to history management
1582
#-------------------------------------------------------------------------
1583
1584 def init_history(self):
1585 """Sets up the command history, and starts regular autosaves."""
-> 1586 self.history_manager = HistoryManager(shell=self, parent=self)
self.history_manager = None
global HistoryManager = <class 'IPython.core.history.HistoryManager'>
global shell = undefined
self = <sage.repl.interpreter.SageTerminalInteractiveShell object at
0x7f734c8609d0>
global parent = undefined
1587 self.configurables.append(self.history_manager)
1588
1589
#-------------------------------------------------------------------------
1590 # Things related to exception handling and tracebacks (not
debugging)
1591
#-------------------------------------------------------------------------
1592
1593 def init_traceback_handlers(self, custom_exceptions):
1594 # Syntax error handler.
1595 self.SyntaxTB = ultratb.SyntaxTB(color_scheme='NoColor')
1596
1597 # The interactive one is initialized with an offset, meaning we
always
1598 # want to remove the topmost item in the traceback, which is
our own
1599 # internal code. Valid modes: ['Plain','Context','Verbose']
1600 self.InteractiveTB = ultratb.AutoFormattedTB(mode = 'Plain',
1601
color_scheme='NoColor',
/usr/lib/sagemath/local/lib/python2.7/site-packages/IPython/core/history.pyc in
__init__(self=<IPython.core.history.HistoryManager object>,
shell=<sage.repl.interpreter.SageTerminalInteractiveShell object>, config=None,
**traits={'parent': <sage.repl.interpreter.SageTerminalInteractiveShell
object>})
505 _exit_re = re.compile(r"(exit|quit)(\s*\(.*\))?$")
506
507 def __init__(self, shell=None, config=None, **traits):
508 """Create a new history manager associated with a shell
instance.
509 """
510 # We need a pointer back to the shell for various tasks.
511 super(HistoryManager, self).__init__(shell=shell, config=config,
512 **traits)
513 self.save_flag = threading.Event()
514 self.db_input_cache_lock = threading.Lock()
515 self.db_output_cache_lock = threading.Lock()
516
517 try:
518 self.new_session()
519 except OperationalError:
--> 520 self.log.error("Failed to create history session in %s.
History will not be saved.",
self.log.error = undefined
self.hist_file =
u'/home/anubhab/.sage/ipython-4.1.2/profile_default/history.sqlite'
global exc_info = undefined
global True = undefined
521 self.hist_file, exc_info=True)
522 self.hist_file = ':memory:'
523
524 if self.enabled and self.hist_file != ':memory:':
525 self.save_thread = HistorySavingThread(self)
526 self.save_thread.start()
527
528 def _get_hist_file_name(self, profile=None):
529 """Get default history file name based on the Shell's profile.
530
531 The profile parameter is ignored, but must exist for
compatibility with
532 the parent class."""
533 profile_dir = self.shell.profile_dir.location
534 return os.path.join(profile_dir, 'history.sqlite')
535
AttributeError: 'HistoryManager' object has no attribute 'log'
***************************************************************************
History of session input: