From 5d37aa2a3375fd973646fe9c21ce5d210a4490f3 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 25 Feb 2020 22:43:45 +0300 Subject: [PATCH] disable cache_discovery to suppress errors in logs: file_cache is unavailable when using oauth2client >= 4.0.0 https://github.com/googleapis/google-api-python-client/issues/299 https://github.com/googleapis/google-api-python-client/issues/325 --- sync_ics2gcal/gcal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync_ics2gcal/gcal.py b/sync_ics2gcal/gcal.py index 6bc9ed9..c6e817f 100644 --- a/sync_ics2gcal/gcal.py +++ b/sync_ics2gcal/gcal.py @@ -26,7 +26,7 @@ class GoogleCalendarService(): scopes = ['https://www.googleapis.com/auth/calendar'] credentials, _ = google.auth.default(scopes=scopes) - service = discovery.build('calendar', 'v3', credentials=credentials) + service = discovery.build('calendar', 'v3', credentials=credentials, cache_discovery=False) return service @staticmethod @@ -40,7 +40,7 @@ class GoogleCalendarService(): scopes = ['https://www.googleapis.com/auth/calendar'] credentials = service_account.Credentials.from_service_account_file(service_account_file) scoped_credentials = credentials.with_scopes(scopes) - service = discovery.build('calendar', 'v3', credentials=scoped_credentials) + service = discovery.build('calendar', 'v3', credentials=scoped_credentials, cache_discovery=False) return service @staticmethod