From 88bc38abc3459fb1e904f2f3be1a6ac7d84b4f5a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 22 Apr 2015 18:38:46 +0530 Subject: [PATCH] Some linux system raise EACCESS instead of EPREM on fchown despite what the manpage says. --- src/calibre/gui2/tweak_book/save.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/save.py b/src/calibre/gui2/tweak_book/save.py index da3691474d..6de2f3127a 100644 --- a/src/calibre/gui2/tweak_book/save.py +++ b/src/calibre/gui2/tweak_book/save.py @@ -43,7 +43,7 @@ def save_container(container, path): try: os.fchown(fno, st.st_uid, st.st_gid) 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 # to a different user, in which case we really cant do anything # about it short of making the file update non-atomic