mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
merge 3.4 (#25471)
This commit is contained in:
commit
2775d85d55
3 changed files with 9 additions and 1 deletions
|
@ -193,7 +193,11 @@ class socket(_socket.socket):
|
||||||
For IP sockets, the address info is a pair (hostaddr, port).
|
For IP sockets, the address info is a pair (hostaddr, port).
|
||||||
"""
|
"""
|
||||||
fd, addr = self._accept()
|
fd, addr = self._accept()
|
||||||
sock = socket(self.family, self.type, self.proto, fileno=fd)
|
# If our type has the SOCK_NONBLOCK flag, we shouldn't pass it onto the
|
||||||
|
# new socket. We do not currently allow passing SOCK_NONBLOCK to
|
||||||
|
# accept4, so the returned socket is always blocking.
|
||||||
|
type = self.type & ~globals().get("SOCK_NONBLOCK", 0)
|
||||||
|
sock = socket(self.family, type, self.proto, fileno=fd)
|
||||||
# Issue #7995: if no default timeout is set and the listening
|
# Issue #7995: if no default timeout is set and the listening
|
||||||
# socket had a (non-zero) timeout, force the new socket in blocking
|
# socket had a (non-zero) timeout, force the new socket in blocking
|
||||||
# mode to override platform-specific socket flags inheritance.
|
# mode to override platform-specific socket flags inheritance.
|
||||||
|
|
|
@ -3866,6 +3866,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
|
||||||
read, write, err = select.select([self.serv], [], [])
|
read, write, err = select.select([self.serv], [], [])
|
||||||
if self.serv in read:
|
if self.serv in read:
|
||||||
conn, addr = self.serv.accept()
|
conn, addr = self.serv.accept()
|
||||||
|
self.assertIsNone(conn.gettimeout())
|
||||||
conn.close()
|
conn.close()
|
||||||
else:
|
else:
|
||||||
self.fail("Error trying to do accept after select.")
|
self.fail("Error trying to do accept after select.")
|
||||||
|
|
|
@ -189,6 +189,9 @@ Library
|
||||||
- Issue #24881: Fixed setting binary mode in Python implementation of FileIO
|
- Issue #24881: Fixed setting binary mode in Python implementation of FileIO
|
||||||
on Windows and Cygwin. Patch from Akira Li.
|
on Windows and Cygwin. Patch from Akira Li.
|
||||||
|
|
||||||
|
- Issue #25471: Sockets returned from accept() shouldn't appear to be
|
||||||
|
nonblocking.
|
||||||
|
|
||||||
- Issue #25319: When threading.Event is reinitialized, the underlying condition
|
- Issue #25319: When threading.Event is reinitialized, the underlying condition
|
||||||
should use a regular lock rather than a recursive lock.
|
should use a regular lock rather than a recursive lock.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue