Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #27131 -- Passed proper string type to SMTP connection login #7178

Merged
merged 0 commits into from Aug 31, 2016

Conversation

claudep
Copy link
Member

@claudep claudep commented Aug 29, 2016

Thanks slavugan@gmail.com for the report.

@@ -64,7 +68,7 @@ def open(self):
self.connection.starttls(keyfile=self.ssl_keyfile, certfile=self.ssl_certfile)
self.connection.ehlo()
if self.username and self.password:
self.connection.login(self.username, self.password)
self.connection.login(force_str(self.username), force_str(self.password))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a comment that no coercion is needed after dropping Python 2?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's useful. All force_str usage will have to be audited at the time, and most of them will indeed disappear.

@timgraham
Copy link
Member

It could be nice to note in the commit message that this fix is only required on Python 2 (as far as I understand).

@timgraham
Copy link
Member

timgraham commented Aug 30, 2016

By the way, could a Django project work around this by declaring their credentials as bytestrings?

@claudep
Copy link
Member Author

claudep commented Aug 30, 2016

I think you are right about the workaround. I still think it's worth committing, as the patch is testing a little bit deeper inside the SMTP connection process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants