Some linux system raise EACCESS instead of EPREM on fchown despite what the manpage says.

This commit is contained in:
Kovid Goyal 2015-04-22 18:38:46 +05:30
parent bc85aea160
commit 88bc38abc3

View File

@ -43,7 +43,7 @@ def save_container(container, path):
try: try:
os.fchown(fno, st.st_uid, st.st_gid) os.fchown(fno, st.st_uid, st.st_gid)
except EnvironmentError as err: except EnvironmentError as err:
if err.errno != errno.EPERM: if err.errno not in (errno.EPERM, errno.EACCES):
# ignore chown failure as user could be editing file belonging # ignore chown failure as user could be editing file belonging
# to a different user, in which case we really cant do anything # to a different user, in which case we really cant do anything
# about it short of making the file update non-atomic # about it short of making the file update non-atomic