This is my boto3 command for getting the object with a specific key from an S3 bucket:
resp = s3client.get_object(Bucket=\'<>-<>\', Key=\'MzA1MjY1Nzkz
from urllib.parse import unquote key = "MzA1MjY1NzkzX2QudHh0%0A" key = unquote(key)
This will remove all special characters from any key.