summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/streams.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-113538: Don't error in stream reader protocol callback when task ↵Miss Islington (bot)2024-01-041-0/+3
| | | | | | | is cancelled (GH-113690) (#113714) (cherry picked from commit 4681a5271a8598b46021cbc556ac8098ab8a1d81) Co-authored-by: Guido van Rossum <guido@python.org>
* [3.11] gh-109538: Catch closed loop runtime error and issue warning ↵DPR2023-11-201-2/+5
| | | | | | | | | (GH-111983) (#112141) Issue a ResourceWarning instead. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> (cherry picked from commit e0f512797596282bff63260f8102592aad37cdf1)
* [3.11] [3.12] GH-110894: Call loop exception handler for exceptions in ↵Miss Islington (bot)2023-11-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | client_connected_cb (GH-111601) (GH-111632) (#111634) * [3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (GH-111632) (cherry picked from commit 9aa88290d82e2808eed84e7a63d0bf9623f84f53) Co-authored-by: Kumar Aditya <kumaraditya@python.org> Call loop exception handler for exceptions in `client_connected_cb` of `asyncio.start_server` so that applications can handle it.. (cherry picked from commit 229f44d353c71185414a072017f46f125676bdd6) * gh-111644: Fix asyncio test_unhandled_exceptions() (#111713) Fix test_unhandled_exceptions() of test_asyncio.test_streams: break explicitly a reference cycle. Fix also StreamTests.tearDown(): the loop must not be closed explicitly, but using set_event_loop() which takes care of shutting down the executor with executor.shutdown(wait=True). BaseEventLoop.close() calls executor.shutdown(wait=False). (cherry picked from commit ac01e2243a1104b2154c0d1bdbc9f8d5b3ada778) --------- Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.11] Remove loop from docstring for asyncio.streams.open_connection ↵Miss Islington (bot)2023-09-271-3/+2
| | | | | | | | (GH-108528) (#109942) Remove loop from docstring for asyncio.streams.open_connection (GH-108528) (cherry picked from commit e721f7a95186452339dc9e57630d639d549b2521) Co-authored-by: Tom Gillespie <tgbugs@gmail.com>
* [3.11] [3.12] GH-106684: Close `asyncio.StreamWriter` when ↵Miss Islington (bot)2023-08-101-0/+4
| | | | | | | | | | | | `asyncio.StreamWriter` is not closed by application (GH-107650) (GH-107656) (#107836) [3.12] GH-106684: Close `asyncio.StreamWriter` when `asyncio.StreamWriter` is not closed by application (GH-107650) (GH-107656) GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (GH-107650) (cherry picked from commit 41178e41995992bbe417f94bce158de93f9e3188) (cherry picked from commit 7853c769067699c79c0d4fe4967e9d8f8b8b0a5e) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* [3.11] gh-100226: Clarify StreamReader.read behavior (GH-101807) (#102001)Miss Islington (bot)2023-02-231-8/+9
| | | | | | | gh-100226: Clarify StreamReader.read behavior (GH-101807) (cherry picked from commit 77d95c83733722ada35eb1ef89ae5b84a51ddd32) Co-authored-by: Jan Gosmann <jan@hyper-world.de> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* GH-74116: Allow multiple drain waiters for asyncio.StreamWriter (GH-94705) ↵Miss Islington (bot)2022-08-301-19/+16
| | | | | | | | | (#96395) (cherry picked from commit e5b2453e61ba5376831093236d598ef5f9f1de61) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-90467: StreamReaderProtocol - add strong reference to created task ↵Miss Islington (bot)2022-08-301-1/+3
| | | | | | | | | (GH-96323) (#96344) (cherry picked from commit e860e521ec0d84e175269aeb15cf24bd6053ad17) Co-authored-by: Kirill <iam@python273.pw> Co-authored-by: Kirill <iam@python273.pw>
* gh-79156: Add start_tls() method to streams API (#91453)Oleg Iarygin2022-04-151-0/+21
| | | | | | | | | | | | | The existing event loop `start_tls()` method is not sufficient for connections using the streams API. The existing StreamReader works because the new transport passes received data to the original protocol. The StreamWriter must then write data to the new transport, and the StreamReaderProtocol must be updated to close the new transport correctly. The new StreamWriter `start_tls()` updates itself and the reader protocol to the new SSL transport. Co-authored-by: Ian Good <icgood@gmail.com>
* bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() ↵Serhiy Storchaka2021-04-251-5/+9
| | | | | | (GH-23554) asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop. In future releases it will became an alias of asyncio.get_running_loop().
* bpo-42392: Remove loop parameter from asyncio.streams (GH-23517)Yurii Karabas2020-11-261-28/+9
|
* bpo-38529: Fix asyncio stream warning (GH-17474)Andrew Svetlov2019-12-071-18/+1
|
* bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)Yury Selivanov2019-09-301-1161/+91
| | | See https://bugs.python.org/issue38242 for more details
* bpo-36889: Document Stream class and add docstrings (GH-14488)Xtreak2019-09-131-0/+21
| | | | | | | | | | | * This just copies the docs from `StreamWriter` and `StreamReader`. * Add docstring for asyncio functions. https://bugs.python.org/issue36889 Automerge-Triggered-By: @asvetlov
* bpo-38066: Hide internal Stream methods (GH-15762)Andrew Svetlov2019-09-101-6/+43
| | | | | | feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-2/+2
|
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* Replace deprecation warning with RuntimeError (GH-14397)Andrew Svetlov2019-06-271-4/+2
|
* bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs ↵Emmanuel Arias2019-06-051-0/+16
| | | | | | | | | | | | | | | [streams] (GH-13671) This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. Second step: streams.py https://bugs.python.org/issue36373
* bpo-36889: Merge asyncio streams (GH-13251)Andrew Svetlov2019-05-271-142/+1094
| | | https://bugs.python.org/issue36889
* bpo-36801: Temporarily fix regression in writer.drain() (#13330)Andrew Svetlov2019-05-141-3/+1
|
* bpo-36916: asyncio: Swallow unhandled write() exception (GH-13313)Andrew Svetlov2019-05-141-1/+10
|
* bpo-36802: Drop awrite()/aclose(), support await write() and await close() ↵Andrew Svetlov2019-05-091-8/+27
| | | | instead (#13099)
* bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport ↵Andrew Svetlov2019-05-071-8/+13
| | | | | (GH-13098) https://bugs.python.org/issue36801
* Forbid creating of stream objects outside of asyncio (#13101)Andrew Svetlov2019-05-071-16/+51
|
* bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212)Vincent Michel2018-11-081-6/+0
| | | | | The call to `_untrack_reader` is performed too soon, causing the protocol to forget about the reader before `connection_lost` can run and feed the EOF to the reader. See bpo-35065.
* bpo-34666: Implement stream.awrite() and stream.aclose() (GH-9274)Andrew Svetlov2018-09-131-1/+9
|
* bpo-34638: Store a weak reference to stream reader to break strong ↵Andrew Svetlov2018-09-121-10/+81
| | | | | | | | references loop (GH-9201) Store a weak reference to stream readerfor breaking strong references It breaks the strong reference loop between reader and protocol and allows to detect and close the socket if the stream is deleted (garbage collected)
* bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)Andrew Svetlov2018-09-111-40/+8
|
* bpo-33353: test_asyncio use set_write_buffer_limits() (GH-7200)Victor Stinner2018-05-291-1/+1
| | | | | | | Use transport.set_write_buffer_limits() in sendfile tests of test_asyncio to make sure that the protocol is paused after sending 4 KiB. Previously, test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed on FreeBSD if the DATA was smaller than the default limit of 64 KiB.
* bpo-32391: Implement StreamWriter.wait_closed() (#5281)Andrew Svetlov2018-01-241-9/+27
|
* bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)Yury Selivanov2017-12-101-21/+20
|
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-081-45/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Convert asyncio/tasks.py to async/await * Convert asyncio/queues.py to async/await * Convert asyncio/test_utils.py to async/await * Convert asyncio/base_subprocess.py to async/await * Convert asyncio/subprocess.py to async/await * Convert asyncio/streams.py to async/await * Fix comments * Convert asyncio/locks.py to async/await * Convert asyncio.sleep to async def * Add a comment * Add missing news * Convert stubs from AbstrctEventLoop to async functions * Convert subprocess_shell/subprocess_exec * Convert connect_read_pipe/connect_write_pip to async/await syntax * Convert create_datagram_endpoint * Convert create_unix_server/create_unix_connection * Get rid of old style coroutines in unix_events.py * Convert selector_events.py to async/await * Convert wait_closed and create_connection * Drop redundant line * Convert base_events.py * Code cleanup * Drop redundant comments * Fix indentation * Add explicit tests for compatibility between old and new coroutines * Convert windows event loop to use async/await * Fix double awaiting of async function * Convert asyncio/locks.py * Improve docstring * Convert tests to async/await * Convert more tests * Convert more tests * Convert more tests * Convert tests * Improve test
* Fix asyncio.streams.FlowControlMixin docstring typo. (#4578)John Chen2017-12-011-1/+1
|
* asyncio: Remove asyncio/compat.py (#4606)Victor Stinner2017-11-281-1/+0
| | | | | | | | | | The asyncio/compat.py file was written to support Python < 3.5 and Python < 3.5.2. But Python 3.5 doesn't accept bugfixes anymore, only security fixes. There is no more need to backport bugfixes to Python 3.5, and so no need to have a single code base for Python 3.5, 3.6 and 3.7. Say hello (again) to "async" and "await", who became real keywords in Python 3.7 ;-)
* bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409Yury Selivanov2017-11-151-0/+6
|
* bpo-31709: Drop support for asynchronous __aiter__. (#3903)Yury Selivanov2017-10-061-17/+9
|
* Issue #28370: Speedup asyncio.StreamReader.readexactlyYury Selivanov2016-10-051-19/+17
| | | | Patch by Коренберг Марк.
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
|
* Issue #27243: Fix __aiter__ protocolYury Selivanov2016-06-091-0/+6
|
* asyncio: Fix an SSL warning in StreamReaderProtocol.eof_receivedYury Selivanov2016-05-201-0/+7
|
* asyncio/streams: Fix code style; delete LimitOverrunError.message attrYury Selivanov2016-05-161-33/+34
|
* Issue #27041: asyncio: Add loop.create_future methodYury Selivanov2016-05-161-2/+2
|
* asyncio: Break reference cycle in StreamReaderProtocol.connection_lostYury Selivanov2016-05-131-4/+7
|
* Issue #26050: Add asyncio.StreamReader.readuntil() method.Yury Selivanov2016-01-111-38/+187
| | | | Patch by Марк Коренберг.
* asyncio: Sync with githubYury Selivanov2015-12-111-0/+3
|
* asyncio: Add Transport.is_closing()Yury Selivanov2015-11-161-1/+1
| | | | See https://github.com/python/asyncio/pull/291 for details.
* Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* Issue #25441: asyncio: Raise error from drain() when socket is closed.Guido van Rossum2015-10-191-0/+9
|
* Fix StreamReader.__repr__Andrew Svetlov2015-09-291-1/+1
|