From d2f8eadec2709d84a5f29ec0c6629b0cac6ecd27 Mon Sep 17 00:00:00 2001 From: ashwin319 Date: Wed, 26 May 2021 23:34:20 -0400 Subject: [PATCH] Update client.py Fix Unicode-objects must be encoded before hashing in dev_hash.update(timestamp) line --- onesky/client.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/onesky/client.py b/onesky/client.py index ef64ba7..c28bb80 100644 --- a/onesky/client.py +++ b/onesky/client.py @@ -22,9 +22,8 @@ def __init__(self, api_key, api_secret, def create_auth_variables(self): timestamp = str(int(time.time())) - dev_hash = hashlib.md5() - dev_hash.update(timestamp) - dev_hash.update(self.api_secret) + hash_key = str(timestamp) + self.api_secret + dev_hash = hashlib.md5(bytes(hash_key, 'utf-8')) return { 'api_key': self.api_key,