From: Rob Browning Date: Wed, 31 Jul 2013 16:32:17 +0000 (-0500) Subject: _create_via_common_rec: treat rmdir() EEXIST like ENOTEMPTY. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=973f212b0426d7bba35e20988f6939d28e7e1104;p=packages%2Fb%2Fbup.git _create_via_common_rec: treat rmdir() EEXIST like ENOTEMPTY. 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 --- diff --git a/lib/bup/metadata.py b/lib/bup/metadata.py index bdf3738..0cd5e25 100644 --- a/lib/bup/metadata.py +++ b/lib/bup/metadata.py @@ -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