Fix for ValueError: server_hostname #6
Open
romaan7 wants to merge 1 commit intoturbodog:masterfrom
Open
Conversation
…t with a leading dot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A python3.7 bug, pass the hostname to smtplib.SMTP for fixing it.
ansible/ansible#44552
Full Stacktrace:
ling.com roman.shaikh@greyhoundrecycling.com smtp.office365.com connect: ('smtp.office365.com', 587) connect: to ('smtp.office365.com', 587) None reply: b'220 LO2P123CA0016.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 7 Apr 2020 13:09:35 +0000\r\n' reply: retcode (220); Msg: b'LO2P123CA0016.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 7 Apr 2020 13:09:35 +0000' connect: b'LO2P123CA0016.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 7 Apr 2020 13:09:35 +0000' send: 'ehlo LAPTOP-SL6JSTP1.Greyhound.local\r\n' reply: b'250-LO2P123CA0016.outlook.office365.com Hello [109.255.38.119]\r\n' reply: b'250-SIZE 157286400\r\n' reply: b'250-PIPELINING\r\n' reply: b'250-DSN\r\n' reply: b'250-ENHANCEDSTATUSCODES\r\n' reply: b'250-STARTTLS\r\n' reply: b'250-8BITMIME\r\n' reply: b'250-BINARYMIME\r\n' reply: b'250-CHUNKING\r\n' reply: b'250 SMTPUTF8\r\n' reply: retcode (250); Msg: b'LO2P123CA0016.outlook.office365.com Hello [109.255.38.119]\nSIZE 157286400\nPIPELINING\nDSN\nENHANCEDSTATUSCODES\nSTARTTLS\n8BITMIME\nBINARYMIME\nCHUNKING\nSMTPUTF8' send: 'STARTTLS\r\n' reply: b'220 2.0.0 SMTP server ready\r\n' reply: retcode (220); Msg: b'2.0.0 SMTP server ready' Traceback (most recent call last): File "smtptest.py", line 86, in <module> if options.usetls: server.starttls() File "C:\Users\roman.shaikh.GREYHOUND\AppData\Local\Programs\Python\Python37\lib\smtplib.py", line 771, in starttls server_hostname=self._host) File "C:\Users\roman.shaikh.GREYHOUND\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 423, in wrap_socket session=session File "C:\Users\roman.shaikh.GREYHOUND\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 863, in _create owner=self, session=self._session, ValueError: server_hostname cannot be an empty string or start with a leading dot.