From 63b9475f799575b878d35dd69ce1a3a9563e6655 Mon Sep 17 00:00:00 2001 From: Parteek Goyal Date: Fri, 4 Aug 2023 19:27:45 +0530 Subject: [PATCH] Update contribute.py --- contribute.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contribute.py b/contribute.py index 6f156ea..aa66d32 100644 --- a/contribute.py +++ b/contribute.py @@ -103,8 +103,10 @@ def remove_prefix(text, prefix): # Decode Github Token def decode_token(encoded_token): - decoded_bytes = base64.b64decode(encoded_token.encode('utf-8')) - decoded_token = decoded_bytes.decode('utf-8') + decoded_bytes = encoded_token.encode("ascii") + convertedbytes = base64.b64decode(decoded_bytes) + decoded_token = convertedbytes.decode("ascii") + print('token decoded successfully') return decoded_token @@ -156,6 +158,7 @@ def decode_token(encoded_token): if isImageFile(filename): with open(path, 'rb') as file: image = file.read() + print('image processing') content = base64.b64encode(image).decode('utf-8') else: with open(path, 'r') as file: @@ -166,5 +169,6 @@ def decode_token(encoded_token): commitAndUpdateRef(repo,tree_content,base_ref.commit,branch) runWorkflow(repo,upstream_repo) except Exception as e: + print(e) print("Some error Occured.Please try again after some time.",end="") exit(0) \ No newline at end of file