Interactive shell initialisation fails if startup cwd no longer exists
- Dominant language
- Python
- Stars
- 16.8k
- Forks
- 4.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 6
Description
Interactive shell initialisation fails if startup cwd no longer exists, leading to errors like:
File "/usr/lib/python2.7/dist-packages/IPython/terminal/embed.py", line 158, in __init__
super(InteractiveShellEmbed,self).__init__(**kw)
File "/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py", line 438, in __init__
super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 456, in __init__
self.init_instance_attrs()
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 575, in init_instance_attrs
self.starting_dir = py3compat.getcwd()
OSError: [Errno 2] No such file or directory
This happened to me with IPython 5.5.0, Python 2.7.14 but a cursory look at master's core/interactiveshell.py suggests the issue is still present there as well.
Contributor guide
Assessment
This issue has not been assessed yet.