ipython/ipython — pull request #7316 by yarikoptic (2014-12-26 15:48:39+00:00)
Title: BF(BK): cleanup tempdir in EmbeddedSphinxShell atexit

my testing server's /tmp was filling up with /tmp/profile_ directories left by statsmodels, pandas, etc I guess due to this extension. Unfortunately this fix (remove tempdir upon exit) has side-effect which experts might need to resolve properly anyways:

```
$> PYTHONPATH=$PWD python -c 'from IPython.sphinxext.ipython_directive import EmbeddedSphinxShell as ESS; _ = ESS(); '
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 "IPython/core/interactiveshell.py", line 3368, in atexit_operations
self.history_manager.end_session()
File "IPython/core/history.py", line 540, in end_session
len(self.input_hist_parsed)-1, self.session_number))
OperationalError: attempt to write a readonly database
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "IPython/core/interactiveshell.py", line 3368, in atexit_operations
self.history_manager.end_session()
File "IPython/core/history.py", line 540, in end_session
len(self.input_hist_parsed)-1, self.session_number))
sqlite3.OperationalError: attempt to write a readonly database
```