bpo-39259: poplib.POP3/POP3_SSL now reject timeout = 0#17912
Merged
vstinner merged 4 commits intopython:masterfrom Jan 10, 2020
Merged
bpo-39259: poplib.POP3/POP3_SSL now reject timeout = 0#17912vstinner merged 4 commits intopython:masterfrom
vstinner merged 4 commits intopython:masterfrom
Conversation
vstinner
reviewed
Jan 9, 2020
| def testTimeoutDefault(self): | ||
| self.assertIsNone(socket.getdefaulttimeout()) | ||
| socket.setdefaulttimeout(30) | ||
| socket.setdefaulttimeout(test_support.SHORT_TIMEOUT) |
Member
There was a problem hiding this comment.
When I added timeout constants to the test.support module, I decided to leave this test unchanged. I understood that the test doesn't connect to real socket. Or does it? I'm not sure. If it does, LOOPBACK_TIMEOUT is preferred.
Member
Author
There was a problem hiding this comment.
Line 107 in eef1b02
As you can see poplib client's constructor actually makes a connection to the server and get a response.
cpython/Lib/test/test_poplib.py
Line 484 in eef1b02
So this test intends to check whether poplib client is set by a global socket timeout and also check whether the connection is succeeded.
Member
Author
|
@vstinner I have made the requested changes; please review again |
|
Thanks for making the requested changes! : please review the changes made to this pull request. |
vstinner
reviewed
Jan 10, 2020
Co-Authored-By: Victor Stinner <[email protected]>
vstinner
reviewed
Jan 10, 2020
Co-Authored-By: Victor Stinner <[email protected]>
shihai1991
pushed a commit
to shihai1991/cpython
that referenced
this pull request
Jan 31, 2020
poplib.POP3 and poplib.POP3_SSL now raise a ValueError if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket.
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.
https://bugs.python.org/issue39259