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 taleinat
Recipients JustAnother1, barry, david__, giampaolo.rodola, r.david.murray, taleinat
Date 2018-06-17.19:03:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529262209.73.0.56676864532.issue29750@psf.upfronthosting.co.za>
In-reply-to
Content
> And yes, by binary passwords I mean that the module needs to support being passed a bytes-like object as the password, since clearly there are servers "in the wild" that support non-ascii passwords and the only way to be sure one can send the server the correct password is by treating it as a series of bytes.  The library caller will have to be responsible for picking the correct encoding based on local knowledge.

Perhaps we should make smtplib accept only bytes, passing on the responsibility of using an appropriate encoding to its users?  This seems like the most straightforward and transparent choice. It would not be backwards-compatible, though.

Alternatively, we could change smtplib to accept passwords as bytes or strings, but raise an informative exception when given strings with non-ASCII characters.  As now, users could be surprised if they have been passing passwords as string and hadn't tested their use of smtplib with non-ASCII passwords.  We'd just improve the exception and documentation to clarify the situation.
History
Date User Action Args
2018-06-17 19:03:29taleinatsetrecipients: + taleinat, barry, giampaolo.rodola, r.david.murray, david__, JustAnother1
2018-06-17 19:03:29taleinatsetmessageid: <1529262209.73.0.56676864532.issue29750@psf.upfronthosting.co.za>
2018-06-17 19:03:29taleinatlinkissue29750 messages
2018-06-17 19:03:29taleinatcreate