From cc74ae4db5499fc0d2ddfc6e682dd21da71ea6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kroupa?= Date: Thu, 4 Jan 2024 13:55:41 +0100 Subject: [PATCH] Use date parse function for P3.6 compatibility --- pykeepass/pykeepass.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pykeepass/pykeepass.py b/pykeepass/pykeepass.py index 5db4682a..f0131c1c 100644 --- a/pykeepass/pykeepass.py +++ b/pykeepass/pykeepass.py @@ -28,7 +28,7 @@ BLANK_DATABASE_FILENAME = "blank_database.kdbx" BLANK_DATABASE_LOCATION = os.path.join(os.path.dirname(os.path.realpath(__file__)), BLANK_DATABASE_FILENAME) BLANK_DATABASE_PASSWORD = "password" - +DT_ISOFORMAT = "%Y-%m-%dT%H:%M:%S%z" class PyKeePass(): """Open a KeePass database @@ -810,9 +810,9 @@ def _decode_time(self, text): ) ) except BinasciiError: - return datetime.fromisoformat(text).astimezone(timezone.utc) + return datetime.strptime(text, DT_ISOFORMAT).astimezone(timezone.utc) else: - return datetime.fromisoformat(text).astimezone(timezone.utc) + return datetime.strptime(text, DT_ISOFORMAT).astimezone(timezone.utc) def create_database( filename, password=None, keyfile=None, transformed_key=None