diff --git a/oauth2client/contrib/multistore_file.py b/oauth2client/contrib/multistore_file.py index 13bd440..d1ef51c 100644 --- a/oauth2client/contrib/multistore_file.py +++ b/oauth2client/contrib/multistore_file.py @@ -293,6 +293,8 @@ class _MultiStore(object): elif e.errno == errno.EDEADLK: logger.warn('Lock contention on multistore file, opening ' 'in read-only mode.') + elif e.errno == errno.EACCES: + logger.warn('Cannot access credentials file.') else: raise if not self._file.is_locked(): diff --git a/tests/contrib/test_multistore_file.py b/tests/contrib/test_multistore_file.py index 8cbe0c6..5e1fe77 100644 --- a/tests/contrib/test_multistore_file.py +++ b/tests/contrib/test_multistore_file.py @@ -82,7 +82,8 @@ class MultistoreFileTests(unittest.TestCase): os.close(filehandle) try: - for error_code in (errno.EDEADLK, errno.ENOSYS, errno.ENOLCK): + for error_code in (errno.EDEADLK, errno.ENOSYS, errno.ENOLCK, + errno.EACCES): multistore = multistore_file._MultiStore(filename) multistore._file = _MockLockedFile(filename, error_code) # Should not raise even though the underlying file class did.