Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5ba48079
Commit
5ba48079
authored
Nov 15, 2016
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.5 (issue #28704)
parents
31d9a005
1e8c7677
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
Lib/asyncio/unix_events.py
Lib/asyncio/unix_events.py
+8
-0
Lib/test/test_asyncio/test_unix_events.py
Lib/test/test_asyncio/test_unix_events.py
+10
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/asyncio/unix_events.py
View file @
5ba48079
...
...
@@ -39,6 +39,13 @@ def _sighandler_noop(signum, frame):
pass
try
:
_fspath
=
os
.
fspath
except
AttributeError
:
# Python 3.5 or earlier
_fspath
=
lambda
path
:
path
class
_UnixSelectorEventLoop
(
selector_events
.
BaseSelectorEventLoop
):
"""Unix event loop.
...
...
@@ -256,6 +263,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
)
# Check for abstract socket. `str` and `bytes` paths are supported.
...
...
Lib/test/test_asyncio/test_unix_events.py
View file @
5ba48079
...
...
@@ -4,6 +4,7 @@ import collections
import
errno
import
io
import
os
import
pathlib
import
signal
import
socket
import
stat
...
...
@@ -251,6 +252,15 @@ class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
srv
.
close
()
self
.
loop
.
run_until_complete
(
srv
.
wait_closed
())
@
unittest
.
skipUnless
(
hasattr
(
os
,
'fspath'
),
'no os.fspath'
)
def
test_create_unix_server_pathlib
(
self
):
with
test_utils
.
unix_socket_path
()
as
path
:
path
=
pathlib
.
Path
(
path
)
srv_coro
=
self
.
loop
.
create_unix_server
(
lambda
:
None
,
path
)
srv
=
self
.
loop
.
run_until_complete
(
srv_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
:
coro
=
self
.
loop
.
create_unix_server
(
lambda
:
None
,
file
.
name
)
...
...
Misc/NEWS
View file @
5ba48079
...
...
@@ -60,6 +60,9 @@ Library
-
Issue
#
28703
:
Fix
asyncio
.
iscoroutinefunction
to
handle
Mock
objects
.
-
Issue
#
28704
:
Fix
create_unix_server
to
support
Path
-
like
objects
(
PEP
519
).
Documentation
-------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment