py3: call SMTP.has_extn() with an str
Passing a bytes on Python 3 always returns False, thus starttls is not
properly detected.
--- a/mercurial/mail.py Thu Oct 10 20:27:34 2019 +0200
+++ b/mercurial/mail.py Thu Oct 10 21:00:13 2019 +0200
@@ -49,7 +49,7 @@
self._host = host
def starttls(self, keyfile=None, certfile=None):
- if not self.has_extn(b"starttls"):
+ if not self.has_extn("starttls"):
msg = b"STARTTLS extension not supported by server"
raise smtplib.SMTPException(msg)
(resp, reply) = self.docmd(b"STARTTLS")