Mahmoud Abdelkader added the comment:
Thanks for the clarification Terry. This is indeed not a bug. For reference,
the pieces of code I pasted line-wrapped after the 76th character, which was my
main source of confusion.
After reading RFC3548, I am now informed that the behavior of
New submission from Mahmoud Abdelkader :
Given a string, encoding it with .encode('base64') is not the same as using
base64's b64encode function. I think this is very unclear and unintuitive.
Here's some example code to demonstrate the problem. Before I attempt to subm