File pr_122.patch of Package python-apns2
From 62793cb0eff591bb091d349177a7028bf6f0f6bc Mon Sep 17 00:00:00 2001
From: Joffrey MANDER <joffrey.mander@polyconseil.fr>
Date: Tue, 29 Dec 2020 10:41:56 +0100
Subject: [PATCH 1/2] apns2.credentials: since version 2.0.0 pyJWT encode
method return str
---
apns2/credentials.py | 2 +-
setup.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/apns2/credentials.py b/apns2/credentials.py
index 655893f..028093e 100644
--- a/apns2/credentials.py
+++ b/apns2/credentials.py
@@ -87,7 +87,7 @@ def _get_or_create_topic_token(self) -> str:
}
jwt_token = jwt.encode(token_dict, self.__auth_key,
algorithm=self.__encryption_algorithm,
- headers=headers).decode('ascii')
+ headers=headers)
# Cache JWT token for later use. One JWT token per connection.
# https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns
diff --git a/setup.py b/setup.py
index 2d8fafb..5837572 100755
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@
packages=['apns2'],
install_requires=[
'hyper>=0.7',
- 'PyJWT>=1.4.0,<2.0.0',
+ 'PyJWT>=2.0.0',
'cryptography>=1.7.2',
],
extras_require={