From 6d5321491e6d5c5ec84a44fd95618b048908d141 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 30 Dec 2021 17:56:28 -0500 Subject: [PATCH] Use `b32encode` instead of `b32hexencode` As `b32hexencode` only exists on Python >= 3.10, and the server runs 3.9 --- google_calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google_calendar.py b/google_calendar.py index b4bda49..46488b9 100644 --- a/google_calendar.py +++ b/google_calendar.py @@ -1,6 +1,6 @@ from datetime import datetime import os.path -from base64 import b32hexencode +from base64 import b32encode from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials @@ -47,7 +47,7 @@ class CalendarService: def insert_or_update_event( self, calendar_id: str, id: str, title: str, start: datetime, end: datetime ): - event_id = b32hexencode(id.encode("ascii")).decode("ascii").lower().rstrip("=") + event_id = b32encode(id.encode("ascii")).decode("ascii").lower().rstrip("=") event = { "id": event_id, "summary": title,