***************************************************************************

IPython post-mortem report

{'commit_hash': '3472a85',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/local/sage/local/lib/python2.7/site-packages/IPython',
 'ipython_version': '0.13.2',
 'os_name': 'posix',
 'platform': 'Linux-3.2.0-58-generic-x86_64-with-debian-wheezy-sid',
 'sys_executable': '/usr/local/sage/local/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.5 (default, Jan 27 2014, 17:46:17) \n[GCC 4.7.3]'}

***************************************************************************



***************************************************************************

Crash traceback:

---------------------------------------------------------------------------
OperationalError             Python 2.7.5: /usr/local/sage/local/bin/python
                                                   Sun Sep 13 18:47:03 2015
A problem occured executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/usr/local/sage/src/bin/sage-ipython in <module>()
      2 # -*- coding: utf-8 -*-
      3 """
      4 Sage IPython startup script.
      5 """
      6 from sage.misc.interpreter import SageTerminalApp
      7 
      8 # installs the extra readline commands before the IPython 
initialization begins.
      9 from sage.misc.readline_extra_commands import *
     10 
     11 # Make sure we're using the Sage profile if one isn't specified.
     12 import sys
     13 if '--profile' not in sys.argv:
     14     sys.argv.extend(['--profile', 'sage'])
     15 
     16 app = SageTerminalApp.instance()
---> 17 app.initialize()
        global app.initialize = <bound method SageTerminalApp.initialize of 
<sage.misc.interpreter.SageTerminalApp object at 0x7fdc39088250>>
     18 app.start()

/usr/local/sage/local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.pyc
 in initialize(self=<sage.misc.interpreter.SageTerminalApp object>, argv=None)

/usr/local/sage/local/lib/python2.7/site-packages/IPython/config/application.pyc
 in catch_config_error(method=<function initialize>, 
app=<sage.misc.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={})
     69 
     70 
#-----------------------------------------------------------------------------
     71 # Application class
     72 
#-----------------------------------------------------------------------------
     73 
     74 @decorator
     75 def catch_config_error(method, app, *args, **kwargs):
     76     """Method decorator for catching invalid config 
(Trait/ArgumentErrors) during init.
     77 
     78     On a TraitError (generally caused by bad config), this will print 
the trait's
     79     message, and exit the app.
     80     
     81     For use on init methods, to prevent invoking excepthook on invalid 
input.
     82     """
     83     try:
---> 84         return method(app, *args, **kwargs)
        method = <function initialize at 0x25a2938>
        app = <sage.misc.interpreter.SageTerminalApp object at 0x7fdc39088250>
        args = (None,)
        kwargs = {}
     85     except (TraitError, ArgumentError) as e:
     86         app.print_description()
     87         app.print_help()
     88         app.print_examples()
     89         app.log.fatal("Bad config encountered during initialization:")
     90         app.log.fatal(str(e))
     91         app.log.debug("Config at the time: %s", app.config)
     92         app.exit(1)
     93 
     94 
     95 class ApplicationError(Exception):
     96     pass
     97 
     98 
     99 class Application(SingletonConfigurable):

/usr/local/sage/local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.pyc
 in initialize(self=<sage.misc.interpreter.SageTerminalApp object>, argv=None)
    309     
    310     @catch_config_error
    311     def initialize(self, argv=None):
    312         """Do actions after construct, but before starting the app."""
    313         super(TerminalIPythonApp, self).initialize(argv)
    314         if self.subapp is not None:
    315             # don't bother initializing further, starting subapp
    316             return
    317         if not self.ignore_old_config:
    318             check_for_old_config(self.ipython_dir)
    319         # print self.extra_args
    320         if self.extra_args and not self.something_to_run:
    321             self.file_to_run = self.extra_args[0]
    322         self.init_path()
    323         # create the shell
--> 324         self.init_shell()
        self.init_shell = <bound method SageTerminalApp.init_shell of 
<sage.misc.interpreter.SageTerminalApp object at 0x7fdc39088250>>
    325         # and draw the banner
    326         self.init_banner()
    327         # Now a variety of things that happen after the banner is 
printed.
    328         self.init_gui_pylab()
    329         self.init_extensions()
    330         self.init_code()
    331 
    332     def init_shell(self):
    333         """initialize the InteractiveShell instance"""
    334         # Create an InteractiveShell instance.
    335         # shell.display_banner should always be False for the terminal
    336         # based app, because we call shell.show_banner() by hand below
    337         # so the banner shows *before* all extension loading stuff.
    338         self.shell = 
TerminalInteractiveShell.instance(config=self.config,
    339                         display_banner=False, 
profile_dir=self.profile_dir,

/usr/local/sage/local/lib/python2.7/site-packages/sage/misc/interpreter.pyc in 
init_shell(self=<sage.misc.interpreter.SageTerminalApp object>)
    733         EXAMPLES::
    734 
    735             sage: from sage.misc.interpreter import SageTerminalApp, 
DEFAULT_SAGE_CONFIG
    736             sage: app = SageTerminalApp(config=DEFAULT_SAGE_CONFIG)
    737             sage: app.initialize(argv=[])  # indirect doctest
    738             sage: app.shell
    739             <sage.misc.interpreter.SageInteractiveShell object at 0x...>
    740         """
    741         # We need verbose crashes for the Sage crash handler.  We set 
it here
    742         # so that we don't overwrite the traitlet attribute
    743         self.verbose_crash = True
    744 
    745         # Shell initialization
    746         self.shell = SageInteractiveShell.instance(config=self.config,
    747                         display_banner=False, 
profile_dir=self.profile_dir,
--> 748                         ipython_dir=self.ipython_dir)
        global ipython_dir = undefined
        self.ipython_dir = u'/home/lrodri/.sage/ipython-0.12'
    749         self.shell.configurables.append(self)
    750         
self.shell.extension_manager.load_extension('sage.misc.sage_extension')

/usr/local/sage/local/lib/python2.7/site-packages/IPython/config/configurable.pyc
 in instance(cls=<class 'sage.misc.interpreter.SageInteractiveShell'>, 
*args=(), **kwargs={'config': {'TerminalIPythonApp': {'display_banner': 
False,...sage', 'force_interact': True}, 'ProfileDir': {}}, 'display_banner': 
False, 'ipython_dir': u'/home/lrodri/.sage/ipython-0.12', 'profile_dir': 
<IPython.core.profiledir.ProfileDir object>})
    303             >>> class Foo(SingletonConfigurable): pass
    304             >>> foo = Foo.instance()
    305             >>> foo == Foo.instance()
    306             True
    307 
    308         Create a subclass that is retrived using the base class 
instance::
    309 
    310             >>> class Bar(SingletonConfigurable): pass
    311             >>> class Bam(Bar): pass
    312             >>> bam = Bam.instance()
    313             >>> bam == Bar.instance()
    314             True
    315         """
    316         # Create and save the instance
    317         if cls._instance is None:
--> 318             inst = cls(*args, **kwargs)
        inst = undefined
        cls = <class 'sage.misc.interpreter.SageInteractiveShell'>
        args = ()
        kwargs = {'ipython_dir': u'/home/lrodri/.sage/ipython-0.12', 
'display_banner': False, 'config': {'TerminalIPythonApp': {'display_banner': 
False, 'verbose_crash': True}, 'TerminalInteractiveShell': {'separate_in': '', 
'ast_node_interactivity': 'all', 'colors': 'LightBG', 'confirm_exit': False}, 
'PromptManager': {'out_template': '', 'in2_template': '....: ', 'in_template': 
'sage: ', 'justify': False}, 'SageTerminalApp': {'profile': u'sage', 
'force_interact': True}, 'ProfileDir': {}}, 'profile_dir': 
<IPython.core.profiledir.ProfileDir object at 0x25a5dd0>}
    319             # Now make sure that the instance will also be returned by
    320             # parent classes' _instance attribute.
    321             for subclass in cls._walk_mro():
    322                 subclass._instance = inst
    323 
    324         if isinstance(cls._instance, cls):
    325             return cls._instance
    326         else:
    327             raise MultipleInstanceError(
    328                 'Multiple incompatible subclass instances of '
    329                 '%s are being created.' % cls.__name__
    330             )
    331 
    332     @classmethod
    333     def initialized(cls):

/usr/local/sage/local/lib/python2.7/site-packages/IPython/frontend/terminal/interactiveshell.pyc
 in __init__(self=<sage.misc.interpreter.SageInteractiveShell object>, 
config={'TerminalIPythonApp': {'display_banner': False,...sage', 
'force_interact': True}, 'ProfileDir': {}}, 
ipython_dir=u'/home/lrodri/.sage/ipython-0.12', 
profile_dir=<IPython.core.profiledir.ProfileDir object>, user_ns=None, 
user_module=None, custom_exceptions=((), None), usage=None, banner1=None, 
banner2=None, display_banner=False)
    345     )
    346     term_title = CBool(False, config=True,
    347         help="Enable auto setting the terminal title."
    348     )
    349 
    350     # In the terminal, GUI control is done via PyOS_InputHook
    351     from IPython.lib.inputhook import enable_gui
    352     enable_gui = staticmethod(enable_gui)
    353     
    354     def __init__(self, config=None, ipython_dir=None, profile_dir=None,
    355                  user_ns=None, user_module=None, 
custom_exceptions=((),None),
    356                  usage=None, banner1=None, banner2=None, 
display_banner=None):
    357 
    358         super(TerminalInteractiveShell, self).__init__(
    359             config=config, profile_dir=profile_dir, user_ns=user_ns,
--> 360             user_module=user_module, custom_exceptions=custom_exceptions
        user_module = None
        custom_exceptions = ((), None)
    361         )
    362         # use os.system instead of utils.process.system by default,
    363         # because piped system doesn't make sense in the Terminal:
    364         self.system = self.system_raw
    365 
    366         self.init_term_title()
    367         self.init_usage(usage)
    368         self.init_banner(banner1, banner2, display_banner)
    369 
    370     
#-------------------------------------------------------------------------
    371     # Things related to the terminal
    372     
#-------------------------------------------------------------------------
    373 
    374     @property
    375     def usable_screen_length(self):

/usr/local/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
 in __init__(self=<sage.misc.interpreter.SageInteractiveShell object>, 
config={'TerminalIPythonApp': {'display_banner': False,...sage', 
'force_interact': True}, 'ProfileDir': {}}, ipython_dir=None, 
profile_dir=<IPython.core.profiledir.ProfileDir object>, user_module=None, 
user_ns=None, custom_exceptions=((), None))
    421         self.init_create_namespaces(user_module, user_ns)
    422         # This has to be done after init_create_namespaces because it 
uses
    423         # something in self.user_ns, but before init_sys_modules, which
    424         # is the first thing to modify sys.
    425         # TODO: When we override sys.stdout and sys.stderr before this 
class
    426         # is created, we are saving the overridden ones here. Not sure 
if this
    427         # is what we want to do.
    428         self.save_sys_module_state()
    429         self.init_sys_modules()
    430 
    431         # While we're trying to have each part of the code directly 
access what
    432         # it needs without keeping redundant references to objects, we 
have too
    433         # much legacy code that expects ip.db to exist.
    434         self.db = PickleShareDB(os.path.join(self.profile_dir.location, 
'db'))
    435 
--> 436         self.init_history()
        self.init_history = <bound method SageInteractiveShell.init_history of 
<sage.misc.interpreter.SageInteractiveShell object at 0x259ef90>>
    437         self.init_encoding()
    438         self.init_prefilter()
    439 
    440         self.init_syntax_highlighting()
    441         self.init_hooks()
    442         self.init_pushd_popd_magic()
    443         # self.init_traceback_handlers use to be here, but we moved it 
below
    444         # because it and init_io have to come after init_readline.
    445         self.init_user_ns()
    446         self.init_logger()
    447         self.init_alias()
    448         self.init_builtins()
    449 
    450         # The following was in post_config_initialization
    451         self.init_inspector()

/usr/local/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
 in init_history(self=<sage.misc.interpreter.SageInteractiveShell object>)
   1474         with self.builtin_trap:
   1475             info = self._object_find(oname)
   1476             if info.found:
   1477                 return self.inspector.info(info.obj, oname, info=info,
   1478                             detail_level=detail_level
   1479                 )
   1480             else:
   1481                 return oinspect.object_info(name=oname, found=False)
   1482 
   1483     
#-------------------------------------------------------------------------
   1484     # Things related to history management
   1485     
#-------------------------------------------------------------------------
   1486 
   1487     def init_history(self):
   1488         """Sets up the command history, and starts regular autosaves."""
-> 1489         self.history_manager = HistoryManager(shell=self, 
config=self.config)
        self.history_manager = None
        global HistoryManager = <class 'IPython.core.history.HistoryManager'>
        global shell = undefined
        self = <sage.misc.interpreter.SageInteractiveShell object at 0x259ef90>
        global config = undefined
        self.config = {'TerminalIPythonApp': {'display_banner': False, 
'verbose_crash': True}, 'TerminalInteractiveShell': {'separate_in': '', 
'ast_node_interactivity': 'all', 'colors': 'LightBG', 'confirm_exit': False}, 
'PromptManager': {'out_template': '', 'in2_template': '....: ', 'in_template': 
'sage: ', 'justify': False}, 'SageTerminalApp': {'profile': u'sage', 
'force_interact': True}, 'ProfileDir': {}}
   1490         self.configurables.append(self.history_manager)
   1491 
   1492     
#-------------------------------------------------------------------------
   1493     # Things related to exception handling and tracebacks (not 
debugging)
   1494     
#-------------------------------------------------------------------------
   1495 
   1496     def init_traceback_handlers(self, custom_exceptions):
   1497         # Syntax error handler.
   1498         self.SyntaxTB = ultratb.SyntaxTB(color_scheme='NoColor')
   1499 
   1500         # The interactive one is initialized with an offset, meaning we 
always
   1501         # want to remove the topmost item in the traceback, which is 
our own
   1502         # internal code. Valid modes: ['Plain','Context','Verbose']
   1503         self.InteractiveTB = ultratb.AutoFormattedTB(mode = 'Plain',
   1504                                                      
color_scheme='NoColor',

/usr/local/sage/local/lib/python2.7/site-packages/IPython/core/history.pyc in 
__init__(self=<IPython.core.history.HistoryManager object>, 
shell=<sage.misc.interpreter.SageInteractiveShell object>, 
config={'TerminalIPythonApp': {'display_banner': False,...sage', 
'force_interact': True}, 'ProfileDir': {}}, **traits={})
    457     _exit_re = re.compile(r"(exit|quit)(\s*\(.*\))?$")
    458 
    459     def __init__(self, shell=None, config=None, **traits):
    460         """Create a new history manager associated with a shell 
instance.
    461         """
    462         # We need a pointer back to the shell for various tasks.
    463         super(HistoryManager, self).__init__(shell=shell, config=config,
    464             **traits)
    465         self.save_flag = threading.Event()
    466         self.db_input_cache_lock = threading.Lock()
    467         self.db_output_cache_lock = threading.Lock()
    468         if self.enabled and self.hist_file != ':memory:':
    469             self.save_thread = HistorySavingThread(self)
    470             self.save_thread.start()
    471 
--> 472         self.new_session()
        self.new_session = <bound method HistoryManager.new_session of 
<IPython.core.history.HistoryManager object at 0x25a5910>>
    473 
    474     def _get_hist_file_name(self, profile=None):
    475         """Get default history file name based on the Shell's profile.
    476         
    477         The profile parameter is ignored, but must exist for 
compatibility with
    478         the parent class."""
    479         profile_dir = self.shell.profile_dir.location
    480         return os.path.join(profile_dir, 'history.sqlite')
    481     
    482     @needs_sqlite
    483     def new_session(self, conn=None):
    484         """Get a new session number."""
    485         if conn is None:
    486             conn = self.db
    487         

/usr/local/sage/local/lib/python2.7/site-packages/IPython/core/history.pyc in 
new_session(self=<IPython.core.history.HistoryManager object>, conn=None)

/usr/local/sage/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={})
     47         pass
     48     
     49     def __enter__(self, *args, **kwargs):
     50         pass
     51     
     52     def __exit__(self, *args, **kwargs):
     53         pass
     54 
     55 
     56 @decorator
     57 def needs_sqlite(f, self, *a, **kw):
     58     """return an empty list in the absence of sqlite"""
     59     if sqlite3 is None or not self.enabled:
     60         return []
     61     else:
---> 62         return f(self, *a, **kw)
        f = <function new_session at 0x237fb90>
        self = <IPython.core.history.HistoryManager object at 0x25a5910>
        a = (None,)
        kw = {}
     63 
     64 
     65 if sqlite3 is not None:
     66     DatabaseError = sqlite3.DatabaseError
     67 else:
     68     class DatabaseError(Exception):
     69         "Dummy exception when sqlite could not be imported. Should 
never occur."
     70 
     71 @decorator
     72 def catch_corrupt_db(f, self, *a, **kw):
     73     """A decorator which wraps HistoryAccessor method calls to catch 
errors from
     74     a corrupt SQLite database, move the old database out of the way, 
and create
     75     a new one.
     76     """
     77     try:

/usr/local/sage/local/lib/python2.7/site-packages/IPython/core/history.pyc in 
new_session(self=<IPython.core.history.HistoryManager object>, 
conn=<sqlite3.Connection object>)
    475         """Get default history file name based on the Shell's profile.
    476         
    477         The profile parameter is ignored, but must exist for 
compatibility with
    478         the parent class."""
    479         profile_dir = self.shell.profile_dir.location
    480         return os.path.join(profile_dir, 'history.sqlite')
    481     
    482     @needs_sqlite
    483     def new_session(self, conn=None):
    484         """Get a new session number."""
    485         if conn is None:
    486             conn = self.db
    487         
    488         with conn:
    489             cur = conn.execute("""INSERT INTO sessions VALUES (NULL, ?, 
NULL,
--> 490                             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
    491             self.session_number = cur.lastrowid
    492             
    493     def end_session(self):
    494         """Close the database session, filling in the end time and line 
count."""
    495         self.writeout_cache()
    496         with self.db:
    497             self.db.execute("""UPDATE sessions SET end=?, num_cmds=? 
WHERE
    498                             session==?""", (datetime.datetime.now(),
    499                             len(self.input_hist_parsed)-1, 
self.session_number))
    500         self.session_number = 0
    501                             
    502     def name_session(self, name):
    503         """Give the current session a name in the history database."""
    504         with self.db:
    505             self.db.execute("UPDATE sessions SET remark=? WHERE 
session==?",

OperationalError: database is locked

***************************************************************************

-- 
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 http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to