diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 29c69a6799..bc99947345 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -388,7 +388,11 @@ class CurrentDir(object): return self.cwd def __exit__(self, *args): - os.chdir(self.cwd) + try: + os.chdir(self.cwd) + except: + # The previous CWD no longer exists + pass class StreamReadWrapper(object):