mirror of
https://git.code.sf.net/p/archivemail/code
synced 2025-03-11 07:12:47 +00:00
Warn if the temporary directory is not empty on cleanup
This commit is contained in:
parent
4fb833176e
commit
573f2b9358
1 changed files with 7 additions and 2 deletions
|
@ -160,8 +160,13 @@ class StaleFiles:
|
|||
vprint("removing stale tempfile directory '%s'" % self.temp_dir)
|
||||
try:
|
||||
os.rmdir(self.temp_dir)
|
||||
self.temp_dir = None
|
||||
except (IOError, OSError): pass
|
||||
except OSError, e:
|
||||
if e.errno == errno.ENOTEMPTY: # Probably a bug
|
||||
user_warning("cannot remove temporary directory '%s', "
|
||||
"directory not empty" % self.temp_dir)
|
||||
except IOError: pass
|
||||
else: self.temp_dir = None
|
||||
|
||||
|
||||
|
||||
class Options:
|
||||
|
|
Loading…
Add table
Reference in a new issue