Lokaltog/powerline — pull request #238 by mpreisler (2013-02-19 20:21:09+00:00)
Title: Handle non-existant CWDs gracefully

This fixes the scenario when user changes directory somewhere into a Mercurial repo, removes the last file there, Mercurial nukes the entire file and powerline spams exceptions.

Instead of spamming exceptions and causing confusion, this change makes powerline output [not found] as current working directory. I believe that this is strictly better, RFC though :-)

This is the exception that gets raised and is never handled:
```
Traceback (most recent call last):
File "/home/mpreisle/.local/bin/powerline", line 37, in
rendered = powerline.renderer.render(width=args.width, side=args.side)
File "/home/mpreisle/.local/lib/python2.7/site-packages/powerline/renderer.py", line 45, in render
segments = [segment for segment in segments\
File "/home/mpreisle/.local/lib/python2.7/site-packages/powerline/theme.py", line 66, in get_segments
contents = segment['contents_func'](**segment['args'])
File "/home/mpreisle/.local/lib/python2.7/site-packages/powerline/segments/common.py", line 55, in cwd
cwd = os.getcwdu()
OSError: [Errno 2] No such file or directory
```