--
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'1961f94',
'commit_source': 'installation',
'default_encoding': 'UTF-8',
'ipython_path': '/opt/SageMath/local/lib/python2.7/site-packages/IPython',
'ipython_version': '4.0.0',
'os_name': 'posix',
'platform': 'Linux-4.4.0-72-generic-x86_64-with-debian-jessie-sid',
'sys_executable': '/opt/SageMath/local/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.7.10 (default, Jan 21 2016, 11:17:06) \n[GCC 4.9.3]'}
***************************************************************************
***************************************************************************
Crash traceback:
---------------------------------------------------------------------------
---------------------------------------------------------------------------
OperationalError Python 2.7.10: /opt/SageMath/local/bin/python
Fri Apr 7 02:21:33 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.
/opt/SageMath/src/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 0x7f9e650f6b50>>
14 app.start()
<decorator-gen-111> in initialize(self=<sage.repl.interpreter.SageTerminalApp
object>, argv=None)
/opt/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={})
60
61
#-----------------------------------------------------------------------------
62 # Application class
63
#-----------------------------------------------------------------------------
64
65 @decorator
66 def catch_config_error(method, app, *args, **kwargs):
67 """Method decorator for catching invalid config
(Trait/ArgumentErrors) during init.
68
69 On a TraitError (generally caused by bad config), this will print
the trait's
70 message, and exit the app.
71
72 For use on init methods, to prevent invoking excepthook on invalid
input.
73 """
74 try:
---> 75 return method(app, *args, **kwargs)
method = <function initialize at 0x7f9e5df89230>
app = <sage.repl.interpreter.SageTerminalApp object at 0x7f9e650f6b50>
args = (None,)
kwargs = {}
76 except (TraitError, ArgumentError) as e:
77 app.print_help()
78 app.log.fatal("Bad config encountered during initialization:")
79 app.log.fatal(str(e))
80 app.log.debug("Config at the time: %s", app.config)
81 app.exit(1)
82
83
84 class ApplicationError(Exception):
85 pass
86
87 class LevelFormatter(logging.Formatter):
88 """Formatter with additional `highlevel` record
89
90 This field is empty if log level is less than highlevel_limit,
/opt/SageMath/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in
initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)
299
300 return super(TerminalIPythonApp, self).parse_command_line(argv)
301
302 @catch_config_error
303 def initialize(self, argv=None):
304 """Do actions after construct, but before starting the app."""
305 super(TerminalIPythonApp, self).initialize(argv)
306 if self.subapp is not None:
307 # don't bother initializing further, starting subapp
308 return
309 # print self.extra_args
310 if self.extra_args and not self.something_to_run:
311 self.file_to_run = self.extra_args[0]
312 self.init_path()
313 # create the shell
--> 314 self.init_shell()
self.init_shell = <bound method SageTerminalApp.init_shell of
<sage.repl.interpreter.SageTerminalApp object at 0x7f9e650f6b50>>
315 # and draw the banner
316 self.init_banner()
317 # Now a variety of things that happen after the banner is
printed.
318 self.init_gui_pylab()
319 self.init_extensions()
320 self.init_code()
321
322 def init_shell(self):
323 """initialize the InteractiveShell instance"""
324 # Create an InteractiveShell instance.
325 # shell.display_banner should always be False for the terminal
326 # based app, because we call shell.show_banner() by hand below
327 # so the banner shows *before* all extension loading stuff.
328 self.shell = TerminalInteractiveShell.instance(parent=self,
329 display_banner=False,
profile_dir=self.profile_dir,
/opt/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/buzzard/.sage/ipython-4.0.0'
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
/opt/SageMath/local/lib/python2.7/site-packages/traitlets/config/configurable.pyc
in instance(cls=<class 'sage.repl.interpreter.SageTerminalInteractiveShell'>,
*args=(), **kwargs={'config': {'TerminalIPythonApp': {'shell_class': <class
's...se}, 'SageTerminalApp': {'force_interact': True}}, 'display_banner':
False, 'ipython_dir': u'/home/buzzard/.sage/ipython-4.0.0', 'parent':
<sage.repl.interpreter.SageTerminalApp object>, 'profile_dir':
<IPython.core.profiledir.ProfileDir object>})
365 >>> class Foo(SingletonConfigurable): pass
366 >>> foo = Foo.instance()
367 >>> foo == Foo.instance()
368 True
369
370 Create a subclass that is retrived using the base class
instance::
371
372 >>> class Bar(SingletonConfigurable): pass
373 >>> class Bam(Bar): pass
374 >>> bam = Bam.instance()
375 >>> bam == Bar.instance()
376 True
377 """
378 # Create and save the instance
379 if cls._instance is None:
--> 380 inst = cls(*args, **kwargs)
inst = undefined
cls = <class 'sage.repl.interpreter.SageTerminalInteractiveShell'>
args = ()
kwargs = {'ipython_dir': u'/home/buzzard/.sage/ipython-4.0.0',
'display_banner': False, 'config': {'TerminalIPythonApp': {'shell_class':
<class 'sage.repl.interpreter.SageTerminalInteractiveShell'>, 'display_banner':
False, 'test_shell': False, 'verbose_crash': 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}, 'SageTerminalApp': {'force_interact': True}},
'profile_dir': <IPython.core.profiledir.ProfileDir object at 0x7f9e5dfa8190>,
'parent': <sage.repl.interpreter.SageTerminalApp object at 0x7f9e650f6b50>}
381 # Now make sure that the instance will also be returned by
382 # parent classes' _instance attribute.
383 for subclass in cls._walk_mro():
384 subclass._instance = inst
385
386 if isinstance(cls._instance, cls):
387 return cls._instance
388 else:
389 raise MultipleInstanceError(
390 'Multiple incompatible subclass instances of '
391 '%s are being created.' % cls.__name__
392 )
393
394 @classmethod
395 def initialized(cls):
/opt/SageMath/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
in __init__(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>,
ipython_dir=u'/home/buzzard/.sage/ipython-4.0.0',
profile_dir=<IPython.core.profiledir.ProfileDir object>, user_module=None,
user_ns=None, custom_exceptions=((), None), **kwargs={'config':
{'TerminalIPythonApp': {'shell_class': <class 's...se}, 'SageTerminalApp':
{'force_interact': True}}, 'display_banner': False, 'parent':
<sage.repl.interpreter.SageTerminalApp object>})
498 self.init_create_namespaces(user_module, user_ns)
499 # This has to be done after init_create_namespaces because it
uses
500 # something in self.user_ns, but before init_sys_modules, which
501 # is the first thing to modify sys.
502 # TODO: When we override sys.stdout and sys.stderr before this
class
503 # is created, we are saving the overridden ones here. Not sure
if this
504 # is what we want to do.
505 self.save_sys_module_state()
506 self.init_sys_modules()
507
508 # While we're trying to have each part of the code directly
access what
509 # it needs without keeping redundant references to objects, we
have too
510 # much legacy code that expects ip.db to exist.
511 self.db = PickleShareDB(os.path.join(self.profile_dir.location,
'db'))
512
--> 513 self.init_history()
self.init_history = <bound method
SageTerminalInteractiveShell.init_history of
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f9e5df7df50>>
514 self.init_encoding()
515 self.init_prefilter()
516
517 self.init_syntax_highlighting()
518 self.init_hooks()
519 self.init_events()
520 self.init_pushd_popd_magic()
521 # self.init_traceback_handlers use to be here, but we moved it
below
522 # because it and init_io have to come after init_readline.
523 self.init_user_ns()
524 self.init_logger()
525 self.init_builtins()
526
527 # The following was in post_config_initialization
528 self.init_inspector()
/opt/SageMath/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
in init_history(self=<sage.repl.interpreter.SageTerminalInteractiveShell
object>)
1621 with self.builtin_trap:
1622 info = self._object_find(oname)
1623 if info.found:
1624 return self.inspector._format_info(info.obj, oname,
info=info,
1625 detail_level=detail_level
1626 )
1627 else:
1628 raise KeyError(oname)
1629
1630
#-------------------------------------------------------------------------
1631 # Things related to history management
1632
#-------------------------------------------------------------------------
1633
1634 def init_history(self):
1635 """Sets up the command history, and starts regular autosaves."""
-> 1636 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
0x7f9e5df7df50>
global parent = undefined
1637 self.configurables.append(self.history_manager)
1638
1639
#-------------------------------------------------------------------------
1640 # Things related to exception handling and tracebacks (not
debugging)
1641
#-------------------------------------------------------------------------
1642
1643 def init_traceback_handlers(self, custom_exceptions):
1644 # Syntax error handler.
1645 self.SyntaxTB = ultratb.SyntaxTB(color_scheme='NoColor')
1646
1647 # The interactive one is initialized with an offset, meaning we
always
1648 # want to remove the topmost item in the traceback, which is
our own
1649 # internal code. Valid modes: ['Plain','Context','Verbose']
1650 self.InteractiveTB = ultratb.AutoFormattedTB(mode = 'Plain',
1651
color_scheme='NoColor',
/opt/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 if self.enabled and self.hist_file != ':memory:':
517 self.save_thread = HistorySavingThread(self)
518 self.save_thread.start()
519
--> 520 self.new_session()
self.new_session = <bound method HistoryManager.new_session of
<IPython.core.history.HistoryManager object at 0x7f9e5dfa8450>>
521
522 def _get_hist_file_name(self, profile=None):
523 """Get default history file name based on the Shell's profile.
524
525 The profile parameter is ignored, but must exist for
compatibility with
526 the parent class."""
527 profile_dir = self.shell.profile_dir.location
528 return os.path.join(profile_dir, 'history.sqlite')
529
530 @needs_sqlite
531 def new_session(self, conn=None):
532 """Get a new session number."""
533 if conn is None:
534 conn = self.db
535
<decorator-gen-21> in new_session(self=<IPython.core.history.HistoryManager
object>, conn=None)
/opt/SageMath/local/lib/python2.7/site-packages/IPython/core/history.pyc in
needs_sqlite(f=<function new_session>,
self=<IPython.core.history.HistoryManager object>, *a=(None,), **kw={})
53 pass
54
55 def __enter__(self, *args, **kwargs):
56 pass
57
58 def __exit__(self, *args, **kwargs):
59 pass
60
61
62 @decorator
63 def needs_sqlite(f, self, *a, **kw):
64 """Decorator: return an empty list in the absence of sqlite."""
65 if sqlite3 is None or not self.enabled:
66 return []
67 else:
---> 68 return f(self, *a, **kw)
f = <function new_session at 0x7f9e5ecc68c0>
self = <IPython.core.history.HistoryManager object at 0x7f9e5dfa8450>
a = (None,)
kw = {}
69
70
71 if sqlite3 is not None:
72 DatabaseError = sqlite3.DatabaseError
73 OperationalError = sqlite3.OperationalError
74 else:
75 @undoc
76 class DatabaseError(Exception):
77 "Dummy exception when sqlite could not be imported. Should
never occur."
78
79 @undoc
80 class OperationalError(Exception):
81 "Dummy exception when sqlite could not be imported. Should
never occur."
82
83 @decorator
/opt/SageMath/local/lib/python2.7/site-packages/IPython/core/history.pyc in
new_session(self=<IPython.core.history.HistoryManager object>,
conn=<sqlite3.Connection object>)
523 """Get default history file name based on the Shell's profile.
524
525 The profile parameter is ignored, but must exist for
compatibility with
526 the parent class."""
527 profile_dir = self.shell.profile_dir.location
528 return os.path.join(profile_dir, 'history.sqlite')
529
530 @needs_sqlite
531 def new_session(self, conn=None):
532 """Get a new session number."""
533 if conn is None:
534 conn = self.db
535
536 with conn:
537 cur = conn.execute("""INSERT INTO sessions VALUES (NULL, ?,
NULL,
--> 538 NULL, "") """, (datetime.datetime.now(),))
global NULL = undefined
global Close = undefined
global the = undefined
global database = undefined
global session = undefined
global filling = undefined
global end = undefined
global time = undefined
global line = undefined
global count.UPDATE = undefined
global sessions = undefined
global SET = undefined
global num_cmds = undefined
global WHERE = undefined
539 self.session_number = cur.lastrowid
540
541 def end_session(self):
542 """Close the database session, filling in the end time and line
count."""
543 self.writeout_cache()
544 with self.db:
545 self.db.execute("""UPDATE sessions SET end=?, num_cmds=?
WHERE
546 session==?""", (datetime.datetime.now(),
547 len(self.input_hist_parsed)-1,
self.session_number))
548 self.session_number = 0
549
550 def name_session(self, name):
551 """Give the current session a name in the history database."""
552 with self.db:
553 self.db.execute("UPDATE sessions SET remark=? WHERE
session==?",
OperationalError: database is locked
***************************************************************************
History of session input: