← Back to team overview

yade-users team mailing list archive

[Question #250147]: Error occur for sys.exit()

 

New question #250147 on Yade:
https://answers.launchpad.net/yade/+question/250147

When I simply repeat the ''Gravity Deposition" example by adding a exit function, following errors occur. The exit function is simply

import sys
sys.exit()

-------------------
Exception KeyError: KeyError(140000453338880,) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2971, in atexit_operations
    self.history_manager.end_session()
  File "/usr/lib/python2.7/dist-packages/IPython/core/history.py", line 432, in end_session
    self.writeout_cache()
  File "<string>", line 2, in writeout_cache
  File "/usr/lib/python2.7/dist-packages/IPython/core/history.py", line 60, in needs_sqlite
    return f(*a,**kw)
  File "/usr/lib/python2.7/dist-packages/IPython/core/history.py", line 607, in writeout_cache
    self._writeout_input_cache(conn)
  File "/usr/lib/python2.7/dist-packages/IPython/core/history.py", line 591, in _writeout_input_cache
    (self.session_number,)+line)
ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 140001294083904 and this is thread id 140000453338880
Error in sys.exitfunc:
---------------------------------------------------------------------------
ProgrammingError                          Traceback (most recent call last)
/usr/lib/python2.7/atexit.pyc in _run_exitfuncs()
     22         func, targs, kargs = _exithandlers.pop()
     23         try:
---> 24             func(*targs, **kargs)
     25         except SystemExit:
     26             exc_info = sys.exc_info()

/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in atexit_operations(self)
   2969         # this must be *before* the tempfile cleanup, in case of temporary
   2970         # history db
-> 2971         self.history_manager.end_session()
   2972 
   2973         # Cleanup all tempfiles left around

/usr/lib/python2.7/dist-packages/IPython/core/history.pyc in end_session(self)
    430     def end_session(self):
    431         """Close the database session, filling in the end time and line count."""
--> 432         self.writeout_cache()
    433         with self.db:
    434             self.db.execute("""UPDATE sessions SET end=?, num_cmds=? WHERE

/usr/lib/python2.7/dist-packages/IPython/core/history.pyc in writeout_cache(self, conn)

/usr/lib/python2.7/dist-packages/IPython/core/history.pyc in needs_sqlite(f, *a, **kw)
     58         return []
     59     else:
---> 60         return f(*a,**kw)
     61 
     62 

/usr/lib/python2.7/dist-packages/IPython/core/history.pyc in writeout_cache(self, conn)
    605         with self.db_input_cache_lock:
    606             try:
--> 607                 self._writeout_input_cache(conn)
    608             except sqlite3.IntegrityError:
    609                 self.new_session(conn)

/usr/lib/python2.7/dist-packages/IPython/core/history.pyc in _writeout_input_cache(self, conn)
    589             for line in self.db_input_cache:
    590                 conn.execute("INSERT INTO history VALUES (?, ?, ?, ?)",
--> 591                                 (self.session_number,)+line)
    592 
    593     def _writeout_output_cache(self, conn):

ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 140001294083904 and this is thread id 140000453338880


-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.