summaryrefslogtreecommitdiffstats
path: root/python/python3-pykeepass/use_built_in_isoformat_support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'python/python3-pykeepass/use_built_in_isoformat_support.patch')
-rw-r--r--python/python3-pykeepass/use_built_in_isoformat_support.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/python/python3-pykeepass/use_built_in_isoformat_support.patch b/python/python3-pykeepass/use_built_in_isoformat_support.patch
new file mode 100644
index 0000000000..4daf98514b
--- /dev/null
+++ b/python/python3-pykeepass/use_built_in_isoformat_support.patch
@@ -0,0 +1,33 @@
+This patch was taken from Arch Linux's gitlab repo:
+https://gitlab.archlinux.org/archlinux/packaging/packages/python-pykeepass/-/blob/main/0002-Use_built_in_isoformat_support.patch
+--- a/pykeepass/pykeepass.py
++++ b/pykeepass/pykeepass.py
+@@ -28,7 +28,6 @@
+ 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%fZ"
+
+ class PyKeePass():
+ """Open a KeePass database
+@@ -804,7 +803,7 @@ def _encode_time(self, value):
+ struct.pack('<Q', diff_seconds)
+ ).decode('utf-8')
+ else:
+- return value.strftime(DT_ISOFORMAT)
++ return value.isoformat()
+
+ def _decode_time(self, text):
+ """datetime.datetime: Convert base64 time or plaintext time to datetime"""
+@@ -819,9 +818,9 @@ def _decode_time(self, text):
+ )
+ )
+ except BinasciiError:
+- return datetime.strptime(text, DT_ISOFORMAT).replace(tzinfo=timezone.utc)
++ return datetime.fromisoformat(text).replace(tzinfo=timezone.utc)
+ else:
+- return datetime.strptime(text, DT_ISOFORMAT).replace(tzinfo=timezone.utc)
++ return datetime.fromisoformat(text).replace(tzinfo=timezone.utc)
+
+ def create_database(
+ filename, password=None, keyfile=None, transformed_key=None