]> arthur.barton.de Git - bup.git/commitdiff
_create_via_common_rec: treat rmdir() EEXIST like ENOTEMPTY.
authorRob Browning <rlb@defaultvalue.org>
Wed, 31 Jul 2013 16:32:17 +0000 (11:32 -0500)
committerRob Browning <rlb@defaultvalue.org>
Wed, 31 Jul 2013 16:32:22 +0000 (11:32 -0500)
See rmdir(2):

       ENOTEMPTY
              pathname contains entries other than .  and ..  ; or,
              pathname has ..  as its final component.  POSIX.1-2001
              also allows EEXIST for this condition.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/metadata.py

index bdf3738faae156fb47d09da7acac8c948c16b516..0cd5e2587d16c9751edf86743a0c79d18d328954 100644 (file)
@@ -288,7 +288,7 @@ class Metadata:
                 try:
                     os.rmdir(path)
                 except OSError, e:
-                    if e.errno == errno.ENOTEMPTY:
+                    if e.errno in (errno.ENOTEMPTY, errno.EEXIST):
                         msg = 'refusing to overwrite non-empty dir ' + path
                         raise Exception(msg)
                     raise