From f33e4e31b72fdab0e47fe8893d53724e7d714c60 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sat, 4 Dec 2021 12:23:23 +0000 Subject: dev-python/deezer: 4.1.0-feat-deserialize-datetime.patch Package-Manager: Portage-3.0.28, Repoman-3.0.3 --- dev-python/deezer/deezer-4.1.0.ebuild | 4 ++++ .../files/4.1.0-feat-deserialize-datetime.patch | 27 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 dev-python/deezer/files/4.1.0-feat-deserialize-datetime.patch (limited to 'dev-python') diff --git a/dev-python/deezer/deezer-4.1.0.ebuild b/dev-python/deezer/deezer-4.1.0.ebuild index df026ddd..350ab4ea 100644 --- a/dev-python/deezer/deezer-4.1.0.ebuild +++ b/dev-python/deezer/deezer-4.1.0.ebuild @@ -21,4 +21,8 @@ BDEPEND="dev-python/sphinx:=" S="${WORKDIR}/${PN}-python-${PV}" +PATCHES=( + "${FILESDIR}/${PV}-feat-deserialize-datetime.patch" +) + distutils_enable_tests pytest diff --git a/dev-python/deezer/files/4.1.0-feat-deserialize-datetime.patch b/dev-python/deezer/files/4.1.0-feat-deserialize-datetime.patch new file mode 100644 index 00000000..ceb8dd59 --- /dev/null +++ b/dev-python/deezer/files/4.1.0-feat-deserialize-datetime.patch @@ -0,0 +1,27 @@ +From 0b8b41f4fadc3479ae4c4c32fe396b7b1f2e9463 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 28 Nov 2021 04:23:54 +0000 +Subject: [PATCH] feat: deserialize datetime + +deezer.get_user().as_dict() leads to be following exception: + + TypeError: Object of type date is not JSON serializable + +This commit provide a deserialization of datetime objec to iso format. +--- + deezer/resources.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/deezer/resources.py b/deezer/resources.py +index 06f57061fbee..5f03d8c7a473 100644 +--- a/deezer/resources.py ++++ b/deezer/resources.py +@@ -54,6 +54,8 @@ class Resource: + value = [i.as_dict() if isinstance(i, Resource) else i for i in value] + if isinstance(value, Resource): + value = value.as_dict() ++ if isinstance(value, dt.date): ++ value = value.isoformat() + result[key] = value + return result + -- cgit v1.2.3