Commit 34d2bd34 authored by bescoto's avatar bescoto

Stop python v2.2 from choking on device files


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@629 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent ee763ba2
......@@ -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)
--------------------------
......
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment