summaryrefslogtreecommitdiff
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-11-20 17:26:28 -0500
committerGitHub <noreply@github.com>2017-11-20 17:26:28 -0500
commit423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c (patch)
tree204591d156333450cc931abfe0e1056e66f2397a /Lib/asyncio
parent895862aa01793a26e74512befb0c66a1da2587d6 (diff)
downloadcpython-git-423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c.tar.gz
bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be optional (#4447)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/events.py4
-rw-r--r--Lib/asyncio/unix_events.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index f2f2e28634..e59d3d2760 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -362,12 +362,12 @@ class AbstractEventLoop:
"""
raise NotImplementedError
- def create_unix_connection(self, protocol_factory, path, *,
+ def create_unix_connection(self, protocol_factory, path=None, *,
ssl=None, sock=None,
server_hostname=None):
raise NotImplementedError
- def create_unix_server(self, protocol_factory, path, *,
+ def create_unix_server(self, protocol_factory, path=None, *,
sock=None, backlog=100, ssl=None):
"""A coroutine which creates a UNIX Domain Socket server.
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index bf682a1a98..be98f334ce 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -212,7 +212,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
self.call_soon_threadsafe(transp._process_exited, returncode)
@coroutine
- def create_unix_connection(self, protocol_factory, path, *,
+ def create_unix_connection(self, protocol_factory, path=None, *,
ssl=None, sock=None,
server_hostname=None):
assert server_hostname is None or isinstance(server_hostname, str)
@@ -229,6 +229,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
raise ValueError(
'path and sock can not be specified at the same time')
+ path = _fspath(path)
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
try:
sock.setblocking(False)