This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author CryptidVulpes
Recipients Claudiu Saftoiu, CryptidVulpes, r.david.murray
Date 2016-07-29.05:55:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469771718.04.0.120616976371.issue27397@psf.upfronthosting.co.za>
In-reply-to
Content
In my opinion, this is still a clear case of "invalid input, raise an error", but I don't think AssertionError is the right one. Maybe just don't catch the unexpected binascii.Error and let it fly towards the user?

I might go even one step further and just let base64 library handle and raise all the necessary errors here, similarly to how your "encode_b" function works.

If you want more error resilience (meaning: email lib would not crash with invalid inputs), I would think returning an empty string is okay, since that base64 input is clearly not a valid base64 that is going to decode into anything.
History
Date User Action Args
2016-07-29 05:55:18CryptidVulpessetrecipients: + CryptidVulpes, r.david.murray, Claudiu Saftoiu
2016-07-29 05:55:18CryptidVulpessetmessageid: <1469771718.04.0.120616976371.issue27397@psf.upfronthosting.co.za>
2016-07-29 05:55:18CryptidVulpeslinkissue27397 messages
2016-07-29 05:55:17CryptidVulpescreate