mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #28399: Remove UNIX socket from FS before binding.
Patch by Коренберг Марк.
This commit is contained in:
parent
0aa7887f43
commit
908d55dd7e
3 changed files with 21 additions and 5 deletions
|
@ -241,11 +241,13 @@ class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
|
|||
with test_utils.unix_socket_path() as path:
|
||||
sock = socket.socket(socket.AF_UNIX)
|
||||
sock.bind(path)
|
||||
with sock:
|
||||
coro = self.loop.create_unix_server(lambda: None, path)
|
||||
with self.assertRaisesRegex(OSError,
|
||||
'Address.*is already in use'):
|
||||
self.loop.run_until_complete(coro)
|
||||
sock.listen(1)
|
||||
sock.close()
|
||||
|
||||
coro = self.loop.create_unix_server(lambda: None, path)
|
||||
srv = self.loop.run_until_complete(coro)
|
||||
srv.close()
|
||||
self.loop.run_until_complete(srv.wait_closed())
|
||||
|
||||
def test_create_unix_server_existing_path_nonsock(self):
|
||||
with tempfile.NamedTemporaryFile() as file:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue