ipython/ipython — Issue #1342: Unable to open a second instance of iPython
Author: jni
Created: 2012-01-29 19:37:13+00:00
State: open

I am getting the following error when trying to open a new iPython instance:

```
$ ipython --pylab
Traceback (most recent call last):
File "/usr/bin/ipython", line 9, in
load_entry_point('ipython==0.12', 'console_scripts', 'ipython')()
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/frontend/terminal/ipapp.py", line 402, in launch_new_instance
app.initialize()
File "", line 2, in initialize
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/config/application.py", line 84, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/frontend/terminal/ipapp.py", line 312, in initialize
self.init_shell()
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/frontend/terminal/ipapp.py", line 332, in init_shell
ipython_dir=self.ipython_dir)
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/config/configurable.py", line 318, in instance
inst = cls(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/frontend/terminal/interactiveshell.py", line 183, in __init__
user_module=user_module, custom_exceptions=custom_exceptions
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/core/interactiveshell.py", line 431, in __init__
self.init_history()
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/core/interactiveshell.py", line 1439, in init_history
self.history_manager = HistoryManager(shell=self, config=self.config)
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/core/history.py", line 407, in __init__
self.new_session()
File "", line 2, in new_session
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/core/history.py", line 61, in needs_sqlite
return f(*a,**kw)
File "/usr/lib/python2.7/site-packages/ipython-0.12-py2.7.egg/IPython/core/history.py", line 425, in new_session
NULL, "") """, (datetime.datetime.now(),))
OperationalError: database is locked

If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org
```

This happens when the other iPython session is executing a particularly lengthy command, but not when it is idle.