I'm using the base64 module for the b64decode() function, however certain strings of text throw this error:
'binascii.Error: Incorrect Padding'.
I understand that this is because the strings are not of length multiple of 4, a requirement of base64 encoded text.
Rather than just adding '='s to the end of the string to make it a multiple of 4, I want to catch the error and simply state that the string is not base64 encoded. It works using a general 'except:', however I want to catch the specific error, but I can't find out the same of the error, as it is not very specific as with other errors, and 'except binascii.Error:' is apparently undefined. Help?