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

bpo-39259: smtp.SMTP/SMTP_SSL now reject timeout = 0 #17958

Merged
merged 1 commit into from Jan 14, 2020

Conversation

@corona10
Copy link
Member

corona10 commented Jan 12, 2020

@corona10 corona10 requested a review from python/email-team as a code owner Jan 12, 2020
@corona10 corona10 requested a review from vstinner Jan 12, 2020
@corona10

This comment has been minimized.

Copy link
Member Author

corona10 commented Jan 12, 2020

@vstinner
Discussion needed:

During I work on this PR, I've noticed that LMTP does not support the timeout parameter.
See: https://docs.python.org/3.9/library/smtplib.html#smtplib.LMTP

However, LMTP also able to use the socket which is created from SMTP.

return SMTP.connect(self, host, port, source_address=source_address)

IMHO LMTP needs to support the timeout parameter.

>>> import socket
>>> sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> sock.settimeout(30)
>>> sock.gettimeout()
30.0
>>> b = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> b.gettimeout()
>>>

Also AFAIK, Unix Socket also able to set a timeout which is used for LMTP protocol
If you agree, I would like to create an issue for this.

@corona10 corona10 force-pushed the corona10:bpo-39259-smtplib branch from e1d29a6 to 29cd207 Jan 12, 2020
@vstinner

This comment has been minimized.

Copy link
Member

vstinner commented Jan 13, 2020

IMHO LMTP needs to support the timeout parameter.

If you think so, please open a separated issue. It's not directly related to https://bugs.python.org/issue39259

Lib/smtplib.py Show resolved Hide resolved
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 13, 2020

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be put in the comfy chair!

@corona10 corona10 requested a review from vstinner Jan 14, 2020
Copy link
Member Author

corona10 left a comment

I have made the requested changes; please review again

@vstinner vstinner merged commit 62e3973 into python:master Jan 14, 2020
9 checks passed
9 checks passed
Docs
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200112.10 succeeded
Details
bedevere/issue-number Issue number 39259 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 2020
petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 2020
petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.