mirror of
https://git.code.sf.net/p/archivemail/code
synced 2025-03-12 07:42:50 +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)
|
vprint("removing stale tempfile directory '%s'" % self.temp_dir)
|
||||||
try:
|
try:
|
||||||
os.rmdir(self.temp_dir)
|
os.rmdir(self.temp_dir)
|
||||||
self.temp_dir = None
|
except OSError, e:
|
||||||
except (IOError, OSError): pass
|
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:
|
class Options:
|
||||||
|
|
Loading…
Add table
Reference in a new issue