summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-09-01 01:55:27 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-09-01 01:55:27 +0000
commitb1bbcfee1956714070ed055a04050d67b1f29190 (patch)
tree4115715c976c5fb0d9c6829103aef88800324bd7
parent790b55b2a59f71268442240181d8456502fd6c09 (diff)
downloadrdiff-backup-b1bbcfee1956714070ed055a04050d67b1f29190.tar.gz
Stop python v2.2 from choking on device files
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@629 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG2
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 00e75af..f6a7057 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -20,6 +20,8 @@ bug#14209: Security bug with --restrict-read-only and
outside path. Bug with --restrict option allowed writes outside path.
(Reported by Charles Duffy.)
+bug #14304: Python 2.2 compatibility spoiled by device files.
+
New in v1.0.0 (2005/08/14)
--------------------------
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 05249ec..aa411a0 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -1045,8 +1045,10 @@ class RPath(RORPath):
mode = stat.S_IFBLK | 0600
else: raise RPathException
try: self.conn.os.mknod(self.path, mode, self.conn.os.makedev(major, minor))
- except OSError, e:
- if e.errno == errno.EPERM:
+ except (OSError, AttributeError), e:
+ if isinstance(e, AttributeError) or e.errno == errno.EPERM:
+ # AttributeError will be raised by Python 2.2, which
+ # doesn't have os.mknod
log.Log("unable to mknod %s -- using touch instead" % self.path, 4)
self.touch()
self.setdata()