mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-39259: nntplib.NNTP/NNTP_SSL now reject timeout = 0 (GH-17936)
nntplib.NNTP and nntplib.NNTP_SSL now raise a ValueError if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket.
This commit is contained in:
parent
136735c1a2
commit
1b335ae281
5 changed files with 24 additions and 0 deletions
|
@ -258,6 +258,10 @@ class NetworkedNNTPTestsMixin:
|
|||
# value
|
||||
setattr(cls, name, wrap_meth(meth))
|
||||
|
||||
def test_timeout(self):
|
||||
with self.assertRaises(ValueError):
|
||||
self.NNTP_CLASS(self.NNTP_HOST, timeout=0, usenetrc=False)
|
||||
|
||||
def test_with_statement(self):
|
||||
def is_connected():
|
||||
if not hasattr(server, 'file'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue