Thread exception handling

cwd option for subprocess.Popen actually does work.