summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/unix_events.py
Commit message (Collapse)AuthorAgeFilesLines
* GH-94597: add deprecation warnings for subclassing `AbstractChildWatcher` ↵Kumar Aditya2022-11-121-0/+7
| | | | (#99386)
* GH-98327: Reduce scope of catch_warnings() in _make_subprocess_transport ↵Kumar Aditya2022-10-171-24/+25
| | | | | (#98333) Alas, warnings.catch_warnings() has global scope, not thread scope, so this is still not perfect, but it reduces the time during which warnings are ignored. Better solution welcome.
* GH-94597: Deprecate child watcher getters and setters (#98215)Kumar Aditya2022-10-151-24/+32
| | | | | | | This is the next step for deprecating child watchers. Until we've removed the API completely we have to use it, so this PR is mostly suppressing a lot of warnings when using the API internally. Once the child watcher API is totally removed, the two child watcher implementations we actually use and need (Pidfd and Thread) will be turned into internal helpers.
* bpo-46364: Use sockets for stdin of asyncio only on AIX (#30596)Christoph Hamsen2022-10-131-4/+3
| | | | Signed-off-by: Christoph Hamsen <hamsen.christoph@posteo.de> Co-authored-by: July Tikhonov <july.tikh@gmail.com>
* GH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and ↵Kumar Aditya2022-10-081-0/+15
| | | | `MultiLoopChildWatcher` child watchers (#98089)
* GH-98023: Change default child watcher to PidfdChildWatcher on supported ↵Kumar Aditya2022-10-081-1/+15
| | | | systems (#98024)
* GH-94182: Run the PidfdChildWatcher on the running loop (#94184)Thomas Grainger2022-10-081-32/+12
| | | | | | | | There is no reason for this watcher to be attached to any particular loop. This should make it safe to use regardless of the lifetime of the event loop running in the main thread (relative to other loops). Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* GH-85760: Fix race in calling process_exited callback too early (#97009)Kumar Aditya2022-09-221-1/+2
|
* Revert "gh-87079: Warn on unintended signal wakeup fd override in `asyncio` ↵Guido van Rossum2022-09-171-16/+3
| | | | | | | (#96807)" (#96898) This reverts commit 05878106989c6f5b9dd35a6c15a21bee59312827. Reason: This broke buildbots (some warnings added by that commit are turned to errors in the SSL buildbot). Repro: ./python Lib/test/ssltests.py
* gh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807)Michel Hidalgo2022-09-171-3/+16
| | | Warn on loop initialization, when setting the wakeup fd disturbs a previously set wakeup fd, and on loop closing, when upon resetting the wakeup fd, we find it has been changed by someone else.
* bpo-44011: New asyncio ssl implementation (#31275)Kumar Aditya2022-02-151-3/+14
| | | | | | | | | | | * bpo-44011: New asyncio ssl implementation Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com> * fix warning * fix typo Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Cleanup a couple of comments left on PR 28775 post-merge. (GH-29079)Gregory P. Smith2021-10-201-1/+1
|
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)Ethan Furman2021-06-181-2/+2
| | | | | | | | | | | | | | | | | | | | | * [Enum] reduce scope of new format behavior Instead of treating all Enums the same for format(), only user mixed-in enums will be affected. In other words, IntEnum and IntFlag will not be changing the format() behavior, due to the requirement that they be drop-in replacements of existing integer constants. If a user creates their own integer-based enum, then the new behavior will apply: class Grades(int, Enum): A = 5 B = 4 C = 3 D = 2 F = 0 Now: format(Grades.B) -> DeprecationWarning and '4' 3.12: -> no warning, and 'B'
* bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)Pablo Galindo2021-05-031-14/+3
| | | | This reverts commit 5fb06edbbb769561e245d0fe13002bab50e2ae60 and all subsequent dependent commits.
* bpo-44011: New asyncio ssl implementation (#17975)Andrew Svetlov2021-05-021-3/+14
|
* bpo-43989: Add signal format specifier for unix_events (GH-25769)Roberto Hueso2021-05-011-2/+2
| | | Add format specifier for IntEnum references to avoid 3.12 deprecation warning.
* bpo-38323: Add guard clauses in MultiLoopChildWatcher. (#22756)Chris Jerdonek2020-12-161-14/+18
| | | This is a trivial refactor in preparation for a fix for bpo-38323.
* bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)Victor Stinner2020-12-161-19/+15
| | | | | test_unix_events.py no longer checks if waitstatus_to_exitcode() mock has been called or not to make the test more functional, rather than checking the exact implementation.
* bpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess ↵Yurii Karabas2020-11-281-1/+1
| | | | (GH-23521)
* s/wakup/wakeup (GH-20250)Kunal Bhalla2020-05-201-1/+1
| | | | | (as title) Automerge-Triggered-By: @Mariatta
* 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-151-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-141-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-041-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-021-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-231-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.