cpython: a3b162d5e70a (original) (raw)

Mercurial > cpython

changeset 104414:a3b162d5e70a 3.5

Issue #28399: Remove UNIX socket from FS before binding. Patch by Коренберг Марк. [#28399]

Yury Selivanov yury@magic.io
date Sun, 09 Oct 2016 12:15:08 -0400
parents 94c9c314f5d9
children 019c5c2f1239 8d877876aa89
files Lib/asyncio/unix_events.py Lib/test/test_asyncio/test_unix_events.py Misc/NEWS
diffstat 3 files changed, 21 insertions(+), 5 deletions(-)[+] [-] Lib/asyncio/unix_events.py 11 Lib/test/test_asyncio/test_unix_events.py 12 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -258,6 +258,17 @@ class _UnixSelectorEventLoop(selector_ev sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

+ try: sock.bind(path) except OSError as exc:

--- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -241,11 +241,13 @@ class SelectorEventLoopUnixSocketTests(t with test_utils.unix_socket_path() as path: sock = socket.socket(socket.AF_UNIX) sock.bind(path)

+

def test_create_unix_server_existing_path_nonsock(self): with tempfile.NamedTemporaryFile() as file:

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -385,6 +385,9 @@ Library