Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36889: Merge asyncio streams #13251

Merged
merged 95 commits into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
1ba375b
Merge StreamReader and StreamWriter
asvetlov May 11, 2019
1af2238
Merge StreamReader and StreamWriter
asvetlov May 11, 2019
d0543a5
Work on
asvetlov May 11, 2019
b3cf11c
Work on
asvetlov May 11, 2019
b059fd9
...
asvetlov May 11, 2019
d5c3391
...
asvetlov May 13, 2019
89d097d
Merge branch 'master' into merge-streams
asvetlov May 13, 2019
abce39c
../..
asvetlov May 13, 2019
0c8e8af
Fix tests
asvetlov May 13, 2019
e0a54d0
kind -> mode
asvetlov May 13, 2019
a632339
Fix streams
asvetlov May 13, 2019
97641eb
Convert subprocess to use Stream instead of StreamReader/StreamWriter
asvetlov May 13, 2019
962495b
Reimplement deprecation strategy
asvetlov May 13, 2019
0ec17ed
Disallow asyncio.StreamReaderProtocol usage outside of asyncio package
asvetlov May 13, 2019
77bf0e4
Fix test___all__
asvetlov May 13, 2019
f46854f
Don't expose asyncio.StreamReaderProtocol
asvetlov May 13, 2019
13f1430
Ignore warning registry in test___all__
asvetlov May 13, 2019
a1bf0b7
Support close on stdout/stderr
asvetlov May 13, 2019
062b570
Fix Windows
asvetlov May 13, 2019
ec24c70
make patchcheck
asvetlov May 13, 2019
a45bdca
Fix import names
asvetlov May 13, 2019
5cc3107
Fix typo
asvetlov May 14, 2019
1d2cf87
Add NEWS
asvetlov May 14, 2019
d2f91c1
Split StreamReaderProtocol into _StreamProtocol and _ServerStreamProt…
asvetlov May 14, 2019
7bc248e
Replace Enum with Flag
asvetlov May 14, 2019
6270289
Add tests for stream mode
asvetlov May 14, 2019
f04352b
Create a server stream in protocol.connection_made()
asvetlov May 14, 2019
e92a1ec
Merge branch 'master' into merge-streams
asvetlov May 14, 2019
e848308
Merge branch 'master' into merge-streams
asvetlov May 14, 2019
958111a
Merge branch 'master' into merge-streams
asvetlov May 15, 2019
2cc72b8
Add conntect method
asvetlov May 15, 2019
7148c6f
Merge branch 'master' into merge-streams
asvetlov May 16, 2019
e7fcb06
Work on
asvetlov May 17, 2019
775860f
Sketch StreamServer class
asvetlov May 17, 2019
75421d7
Work on
asvetlov May 20, 2019
7d11e4f
Fix stream test
asvetlov May 21, 2019
03cc501
Test cleanup
asvetlov May 21, 2019
30b1cb6
Merge branch 'master' into merge-streams
asvetlov May 21, 2019
ca7f479
Add unix server test
asvetlov May 21, 2019
7ff3b9f
Add tests for server.bind()
asvetlov May 21, 2019
a34bbed
Rename private method
asvetlov May 21, 2019
9486196
More tests
asvetlov May 21, 2019
4a4a2e0
More tests
asvetlov May 21, 2019
414939b
Drop low-level server early
asvetlov May 21, 2019
c62b8b4
More tests
asvetlov May 21, 2019
b84cf84
Add more tests
asvetlov May 21, 2019
e233c06
Merge branch 'master' into merge-streams
asvetlov May 22, 2019
f4572c8
Forbid stream servers inheritance
asvetlov May 22, 2019
37a2949
Add tests for stream sendfile
asvetlov May 22, 2019
c73ddfd
Add start_tls method
asvetlov May 22, 2019
3f9bc91
served_names() -> addresses()
asvetlov May 22, 2019
7eca1fc
Drop obsolete TODOs
asvetlov May 22, 2019
ab41dd6
Drop redundant TODO
asvetlov May 22, 2019
1716e92
Add test for stream.is_server_side()
asvetlov May 22, 2019
6a41b1f
Polish
asvetlov May 22, 2019
774e9f1
Fix imports
asvetlov May 22, 2019
c54f64b
Fix inheritance error
asvetlov May 22, 2019
efcb326
Update Lib/asyncio/streams.py
asvetlov May 22, 2019
066d317
Update Lib/asyncio/streams.py
asvetlov May 22, 2019
b64c9af
Update Lib/asyncio/streams.py
asvetlov May 22, 2019
12e4f07
Make client_connected_cb positional-only
asvetlov May 22, 2019
d68f728
Merge branch 'merge-streams' of github.com:asvetlov/cpython into merg…
asvetlov May 22, 2019
035cf3f
addresses -> listeners
asvetlov May 23, 2019
9acd1a2
Revert back StreamReader and StreamWriter
asvetlov May 23, 2019
25d59fe
Fix exception names
asvetlov May 23, 2019
e076498
Deprecate old streams
asvetlov May 23, 2019
ef44960
Fix tests
asvetlov May 23, 2019
6dbe705
Merge branch 'merge-streams' of github.com:asvetlov/cpython into merg…
asvetlov May 23, 2019
504ea78
Process deprecated StreamReader and StreamWriter in test_all
asvetlov May 23, 2019
c1cc242
Deprecate StreamReaderProtocol import
asvetlov May 23, 2019
fd2a6eb
Fix module name
asvetlov May 23, 2019
b6fbc9f
Suppress deprecation warnings
asvetlov May 23, 2019
c190c72
Fix another warning
asvetlov May 23, 2019
d80cb9c
listeners -> sockets
asvetlov May 24, 2019
dcc3353
Merge branch 'master' into merge-streams
asvetlov May 24, 2019
1ae7d8d
Add repr
asvetlov May 24, 2019
9d34da8
Fix comment
asvetlov May 24, 2019
d0c9ada
Fix comment
asvetlov May 24, 2019
af5f27e
Implement async with stream: ...
asvetlov May 24, 2019
a734f06
_low_server -> _server_impl
asvetlov May 24, 2019
e01b394
Support async with asyncio.connect(): ...
asvetlov May 24, 2019
0ef2195
Use _OptionalAwait
asvetlov May 24, 2019
b533f5d
Merge branch 'master' into merge-streams
asvetlov May 25, 2019
75804f6
Imprement connect_read_pipe and connect_write_pipe stream factories
asvetlov May 25, 2019
476de4e
Update Lib/asyncio/streams.py
asvetlov May 27, 2019
2d874c7
Update Lib/asyncio/streams.py
asvetlov May 27, 2019
d5c207b
Fix notes
asvetlov May 27, 2019
30bdbe2
Merge branch 'merge-streams' of github.com:asvetlov/cpython into merg…
asvetlov May 27, 2019
0521b1f
Return _OptionalAwait from stream.close()
asvetlov May 27, 2019
5b4b7fd
Make _check_read() and _check_write() top-level functions
asvetlov May 27, 2019
567f154
Return empty tuple instead of list if StreamServer.sockets is empty
asvetlov May 27, 2019
8cf6bf1
Rename private helpers
asvetlov May 27, 2019
217ea19
Merge branch 'master' into merge-streams
asvetlov May 27, 2019
99f4839
Make more detailed NEWS
asvetlov May 27, 2019
4ac5ce1
Fix tests
asvetlov May 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Lib/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# flake8: noqa

import sys
import warnings

# This relies on each of the submodules having an __all__ variable.
from .base_events import *
Expand Down Expand Up @@ -43,3 +44,40 @@
else:
from .unix_events import * # pragma: no cover
__all__ += unix_events.__all__


__all__ += ('StreamReader', 'StreamWriter', 'StreamReaderProtocol') # deprecated


def __getattr__(name):
global StreamReader, StreamWriter, StreamReaderProtocol
if name == 'StreamReader':
warnings.warn("StreamReader is deprecated since Python 3.8 "
"in favor of Stream, and scheduled for removal "
"in Python 3.10",
DeprecationWarning,
stacklevel=2)
from .streams import StreamReader as sr
StreamReader = sr
return StreamReader
if name == 'StreamWriter':
warnings.warn("StreamWriter is deprecated since Python 3.8 "
"in favor of Stream, and scheduled for removal "
"in Python 3.10",
DeprecationWarning,
stacklevel=2)
from .streams import StreamWriter as sw
StreamWriter = sw
return StreamWriter
if name == 'StreamReaderProtocol':
warnings.warn("Using asyncio internal class StreamReaderProtocol "
"is deprecated since Python 3.8 "
" and scheduled for removal "
"in Python 3.10",
DeprecationWarning,
stacklevel=2)
from .streams import StreamReaderProtocol as srp
StreamReaderProtocol = srp
return StreamReaderProtocol

raise AttributeError(f"module {__name__} has no attribute {name}")
Loading