summaryrefslogtreecommitdiff
path: root/Lib/asyncio/unix_events.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38356: Fix ThreadedChildWatcher thread leak in test_asyncio (GH-16552)Kyle Stanley2020-01-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation for this PR (comment from @vstinner in bpo issue): ``` Warning seen o AMD64 Ubuntu Shared 3.x buildbot: https://buildbot.python.org/all/#/builders/141/builds/2593 test_devnull_output (test.test_a=syncio.test_subprocess.SubprocessThreadedWatcherTests) ... Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2) ``` The following implementation details for the new method are TBD: 1) Public vs private 2) Inclusion in `close()` 3) Name 4) Coroutine vs subroutine method 5) *timeout* parameter If it's a private method, 3, 4, and 5 are significantly less important. I started with the most minimal implementation that fixes the dangling threads without modifying the regression tests, which I think is particularly important. I typically try to avoid directly modifying existing tests as much as possible unless it's necessary to do so. However, I am open to changing any part of this. https://bugs.python.org/issue38356
* bpo-38982: Fix asyncio PidfdChildWatcher on waitpid() error (GH-17477)Victor Stinner2019-12-061-2/+13
| | | | | | If waitpid() is called elsewhere, waitpid() call fails with ChildProcessError: use return code 255 in this case, and log a warning. It ensure that the pidfd file descriptor is closed if this error occurs.
* bpo-38951: Use threading.main_thread() check in asyncio (GH-17433)Hill Ma2019-12-051-3/+2
| | | https://bugs.python.org/issue38951
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-2/+2
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-38692: Add asyncio.PidfdChildWatcher to __all__ (GH-17161)Kyle Stanley2019-11-141-1/+1
| | | | | | | | | | /cc @asvetlov @1st1 https://bugs.python.org/issue38692 Automerge-Triggered-By: @benjaminp
* closes bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069)Benjamin Peterson2019-11-131-0/+67
|
* bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe ↵Andrew Svetlov2019-09-291-0/+11
| | | | (GH-16472)
* Fix typos in docs, comments and test assert messages (#14872)Min ho Kim2019-07-211-1/+1
|
* bpo-35621: Support running subprocesses in asyncio when loop is executed in ↵Andrew Svetlov2019-06-301-29/+244
| | | | non-main thread (GH-14344)
* Revert "bpo-35621: Support running subprocesses in asyncio when loop is ↵Andrew Svetlov2019-06-031-212/+28
| | | | | executed in non-main thread (#13630)" (GH-13793) https://bugs.python.org/issue35621
* Fix typos in docs and docstrings (GH-13745)Xtreak2019-06-031-1/+1
|
* bpo-35621: Support running subprocesses in asyncio when loop is executed in ↵Andrew Svetlov2019-06-021-28/+212
| | | | non-main thread (#13630)
* bpo-37035: Don't log OSError (GH-13548)Andrew Svetlov2019-05-271-1/+1
| | | https://bugs.python.org/issue37035
* bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)Yury Selivanov2019-05-271-5/+15
| | | | | | | | | | | | | | | This will address the common mistake many asyncio users make: an "except Exception" clause breaking Tasks cancellation. In addition to this change, we stop inheriting asyncio.TimeoutError and asyncio.InvalidStateError from their concurrent.futures.* counterparts. There's no point for these exceptions to share the inheritance chain. In 3.9 we'll focus on implementing supervisors and cancel scopes, which should allow better handling of all exceptions, including SystemExit and KeyboardInterrupt
* bpo-35721: Close socket pair if Popen in _UnixSubprocessTransport fails ↵Niklas Fiekas2019-05-201-6/+12
| | | | | | | | (GH-11553) This slightly expands an existing test case `test_popen_error` to trigger a `ResourceWarning` and fixes it. https://bugs.python.org/issue35721
* asyncio: __del__() keep reference to warnings.warn (GH-11491)Victor Stinner2019-01-101-6/+4
| | | | | | | | | | | | | | | * asyncio: __del__() keep reference to warnings.warn The __del__() methods of asyncio classes now keep a strong reference to the warnings.warn() to be able to display the ResourceWarning warning in more cases. Ensure that the function remains available if instances are destroyed late during Python shutdown (while module symbols are cleared). * Rename warn parameter to _warn "_warn" name is a hint that it's not the regular warnings.warn() function.
* bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)Andrew Svetlov2018-09-111-4/+5
|
* bpo-33654: Support BufferedProtocol in set_protocol() and start_tls() (GH-7130)Yury Selivanov2018-05-281-0/+4
| | | | | | | | | | | In this commit: * Support BufferedProtocol in set_protocol() and start_tls() * Fix proactor to cancel readers reliably * Update tests to be compatible with OpenSSL 1.1.1 * Clarify BufferedProtocol docs * Bump TLS tests timeouts to 60 seconds; eliminate possible race from start_serving * Rewrite test_start_tls_server_1
* bpo-33332: Add signal.valid_signals() (GH-6581)Antoine Pitrou2018-05-041-2/+2
|
* bpo-32622: Normalize ENOTCONN to ConnectionError on macOS (GH-5369)Yury Selivanov2018-01-271-0/+11
| | | | On mac, sendfile throws ENOTCONN on a repeated sendfile call if the connection is closed. Normalize it to behave like other systems.
* bpo-32662: Implement Server.start_serving() and Server.serve_forever() (#5312)Yury Selivanov2018-01-251-5/+7
| | | | | | | | | | | | | * bpo-32662: Implement Server.start_serving() and Server.serve_forever() New methods: * Server.start_serving(), * Server.serve_forever(), and * Server.is_serving(). Add 'start_serving' keyword parameter to loop.create_server() and loop.create_unix_server().
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-221-1/+1
|
* bpo-32410: Make SendfileNotAvailableError exception public (#5243)Andrew Svetlov2018-01-191-4/+4
|
* bpo-32410: Implement loop.sock_sendfile() (#4976)Andrew Svetlov2018-01-161-0/+93
|
* bpo-26133: Fix typos (#5010)Andrew Svetlov2017-12-261-2/+2
| | | | | | * Fix typos * Change warning text * Add test
* bpo-26133: Clear signals list on interpreter finalizing (#5002)Andrew Svetlov2017-12-241-4/+7
|
* bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter ↵Andrew Svetlov2017-12-211-2/+8
| | | | shutdown (#4956)
* bpo-29970: Make ssh_handshake_timeout None by default (#4939)Andrew Svetlov2017-12-201-2/+9
| | | | | * Make ssh_handshake_timeout None by default. * Raise ValueError if ssl_handshake_timeout is used without ssl. * Raise ValueError if ssl_handshake_timeout is not positive.
* bpo-29970: Add timeout for SSL handshake in asyncioNeil Aspinall2017-12-191-7/+13
| | | | 10 seconds by default.
* bpo-27456: Simplify sock type checks (#4922)Yury Selivanov2017-12-191-2/+2
| | | | Recent sock.type fix (see bug 32331) makes sock.type checks simpler in asyncio.
* bpo-27456: Ensure TCP_NODELAY is set on linux (#4231)Yury Selivanov2017-12-151-2/+2
|
* bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)Yury Selivanov2017-12-101-27/+25
|
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-091-26/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* bpo-32166: Drop Python 3.4 code from asyncio (#4612)Andrew Svetlov2017-11-291-49/+9
| | | | | | | | | | | | | | | | | | | | | | * Drop Python 3.4 code from asyncio * Fix notes * Add missing imports * Restore comment * Resort imports * Drop Python 3.4-3.5 specific code * Drop redunant check * Fix tests * Restore _COROUTINE_TYPES order * Remove useless code
* bpo-32154: Remove asyncio.selectors (#4605)Victor Stinner2017-11-281-1/+1
| | | | | | | | | | | | * Remove asyncio.selectors and asyncio._overlapped symbols from the namespace of the asyncio module * Replace "from asyncio import selectors" with "import selectors" * Replace "from asyncio import _overlapped" with "import _overlapped" asyncio.selectors was added to support Python 3.3, which doesn't have selectors in its standard library, and Python 3.4 in the same code base. Same rationale for asyncio._overlapped. Python 3.3 reached its end of life, and asyncio is no more maintained as a third party module on PyPI.
* asyncio: use directly socket.socketpair() (#4597)Victor Stinner2017-11-281-4/+1
| | | | | Since Python 3.5, socket.socketpair() is also available on Windows, and so can be used directly, rather than using asyncio.windows_utils.socketpair().
* bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should ↵Yury Selivanov2017-11-201-1/+2
| | | | be optional (#4447)
* bpo-29617: Remove Python 3.3 support from asyncio (GH-232)INADA Naoki2017-04-251-19/+10
|
* Merge 3.5 (issue #28704)Yury Selivanov2016-11-151-0/+8
|\
| * Issue #28704: Fix create_unix_server to support Path-like objectsYury Selivanov2016-11-151-0/+8
| |
* | Merge 3.5 (issue #28652)Yury Selivanov2016-11-091-2/+2
|\ \ | |/
| * Issue #28652: Make loop methods reject socket kinds they do not support.Yury Selivanov2016-11-091-2/+2
| |
* | Merge 3.5 (issue #28399)Yury Selivanov2016-10-091-0/+11
|\ \ | |/
| * Issue #28399: Remove UNIX socket from FS before binding.Yury Selivanov2016-10-091-0/+11
| | | | | | | | Patch by Коренберг Марк.
* | Merge 3.5 (asyncio)Yury Selivanov2016-10-071-2/+9
|\ \ | |/
| * asyncio: Only allow Unix Stream sockets for loop.create_unix_server/connectionYury Selivanov2016-10-071-2/+9
| |
* | Merge 3.5 (issue #28369)Yury Selivanov2016-10-051-13/+13
|\ \ | |/
| * Issue #28369: Raise an error when transport's FD is used with add_readerYury Selivanov2016-10-051-13/+13
| |
* | Merge 3.5 (issue #28368)Yury Selivanov2016-10-051-5/+18
|\ \ | |/
| * Issue #28368: Refuse monitoring processes if the child watcher has no loop ↵Yury Selivanov2016-10-051-5/+18
| | | | | | | | | | | | attached. Patch by Vincent Michel.