try:
stat_cached = os.stat(filename)
except OSError, oe:
+ func_call = "stat('%s')" % filename
if oe.errno == errno.EPERM:
- raise OperationNotPermitted("stat('%s')" % filename)
+ raise OperationNotPermitted(func_call)
+ elif oe.errno == errno.EACCES:
+ raise PermissionDenied(func_call)
elif oe.errno == errno.ENOENT:
raise FileNotFound(filename)
else:
os.chown(filename, uid, gid)
modified = True
except OSError, oe:
+ func_call = "chown('%s', %i, %i)" % (filename, uid, gid)
if oe.errno == errno.EPERM:
- raise OperationNotPermitted("chown('%s', %i, %i)" % (filename, uid, gid))
+ raise OperationNotPermitted(func_call)
+ elif oe.errno == errno.EACCES:
+ raise PermissionDenied(func_call)
+ elif oe.errno == errno.EROFS:
+ raise ReadOnlyFileSystem(func_call)
elif oe.errno == errno.ENOENT:
raise FileNotFound(filename)
else:
func_call = "chmod('%s', %s)" % (filename, oct(new_mode))
if oe.errno == errno.EPERM:
raise OperationNotPermitted(func_call)
+ elif oe.errno == errno.EACCES:
+ raise PermissionDenied(func_call)
elif oe.errno == errno.EROFS:
raise ReadOnlyFileSystem(func_call)
elif oe.errno == errno.ENOENT:
try:
stat_cached = os.stat(filename)
except OSError, oe:
+ func_call = "stat('%s')" % filename
if oe.errno == errno.EPERM:
- raise OperationNotPermitted("stat('%s')" % filename)
+ raise OperationNotPermitted(func_call)
+ elif oe.errno == errno.EACCES:
+ raise PermissionDenied(func_call)
elif oe.errno == errno.ENOENT:
raise FileNotFound(filename)
else: