From f97bcfb1a8799d685722c56f76b6b659836c8810 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 May 2011 10:46:50 -0600 Subject: [PATCH] Try harder to recover on systems where people run temp file cleaners that delete the temp files of running programs --- src/calibre/ptempfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/ptempfile.py b/src/calibre/ptempfile.py index bff13dd248..01e8f18339 100644 --- a/src/calibre/ptempfile.py +++ b/src/calibre/ptempfile.py @@ -29,6 +29,10 @@ def remove_dir(x): def base_dir(): global _base_dir + if _base_dir is not None and not os.path.exists(_base_dir): + # Some people seem to think that running temp file cleaners that + # delete the temp dirs of running programs is a good idea! + _base_dir = None if _base_dir is None: td = os.environ.get('CALIBRE_WORKER_TEMP_DIR', None) if td is not None: