| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#123799)
This switches the main pyrepl event loop to always be non-blocking so that it
can listen to incoming interruptions from other threads.
This also resolves invalid display of exceptions from other threads
(gh-123178).
This also fixes freezes with pasting and an active input hook.
(cherry picked from commit 033510e11dff742d9626b9fd895925ac77f566f1)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
|
|
|
|
|
| |
`asyncio.base_events` (GH-122269) (#122278)
gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_events` (GH-122269)
(cherry picked from commit 070f1e2e5b9b31ee3e7a1af2e30d7e3a66040b17)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
(GH-121958) (GH-122115)
Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
(cherry picked from commit dc93d1125f594ac7aece98558eaf33d09c348519)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
|
|
|
| |
(cherry picked from commit e5c7216f376a06d2c931daf999e2980e494e747e)
Co-authored-by: Milan Oberkirch <milan.oberkirch@geops.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
|
|
|
|
|
| |
(GH-121718)
Set return_code to 1 for ENOTTY
(cherry picked from commit a1834742936a3a2164c25c14ecf4ae6a95288ca3)
Co-authored-by: Milan Oberkirch <milan.oberkirch@geops.com>
|
| |
|
|
|
|
| |
gh-119909: Fix ``NameError`` in ``asyncio`` REPL (GH-121341)
(cherry picked from commit 114389470ec3db457c589b3991b695258d23ce5a)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-121126) (#121194)
gh-87744: fix waitpid race while calling send_signal in asyncio (GH-121126)
asyncio earlier relied on subprocess module to send signals to the process, this has some drawbacks one being that subprocess module unnecessarily calls waitpid on child processes and hence it races with asyncio implementation which internally uses child watchers. To mitigate this, now asyncio sends signals directly to the process without going through the subprocess on non windows systems. On Windows it fallbacks to subprocess module handling but on windows there are no child watchers so this issue doesn't exists altogether.
(cherry picked from commit bd473aa598c5161521a7018896dc124728214a6c)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
|
| |
|
|
|
|
|
| |
ensure that the given socket is in non-blocking mode (GH-119519) (#119912)
(cherry picked from commit cf3bba3f0671d2c9fee099e3ab0f78b98b176131)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
| |
|
|
|
| |
(cherry picked from commit 2237946af0981c46dc7d3886477e425ccfb37f28)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
|
|
|
|
|
| |
(#119206)
gh-119121: Fix and test `async.staggered.staggered_race` (GH-119173)
(cherry picked from commit 16b46ebd2b0025aa461fdfc95fbf98a4f04b49e6)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
| |
(cherry picked from commit c3643a121401d111bebd3e26d6f362ade2ed2a83)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
gh-16429 introduced support for an iterable of separators in
Stream.readuntil. Since bytes-like types are themselves iterable, this
can introduce ambiguities in deciding whether the argument is an
iterator of separators or a singleton separator. In gh-16429, only 'bytes'
was considered a singleton, but this will break code that passes other
buffer object types.
Fix it by only supporting tuples rather than arbitrary iterables.
Closes gh-117722.
|
| |
|
|
|
|
|
|
|
|
| |
This prevents external cancellations of a task group's parent task to
be dropped when an internal cancellation happens at the same time.
Also strengthen the semantics of uncancel() to clear self._must_cancel
when the cancellation count reaches zero.
Co-Authored-By: Tin Tvrtković <tinchester@gmail.com>
Co-Authored-By: Arthur Tacca
|
| | |
|
| | |
|
| |
|
| |
Co-authored-by: Duprat <yduprat@gmail.com>
|
| | |
|
| |
|
|
|
|
|
|
|
| |
* as_completed returns object that is both iterator and async iterator
* Existing tests adjusted to test both the old and new style
* New test to ensure iterator can be resumed
* New test to ensure async iterator yields any passed-in Futures as-is
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
|
| | |
|
| |
|
|
| |
early by asyncio (GH-116774)
|
| |
|
|
|
|
|
| |
These give applications the option of more forcefully terminating client
connections for asyncio servers. Useful when terminating a service and
there is limited time to wait for clients to finish up their work.
This is a do-over with a test fix for gh-114432, which was reverted.
|
| |
|
|
|
|
|
|
|
|
| |
(#114432)" (#116632)
Revert "gh-113538: Add asycio.Server.{close,abort}_clients (#114432)"
Reason: The new test doesn't always pass:
https://github.com/python/cpython/pull/116423#issuecomment-1989425489
This reverts commit 1d0d49a7e86257ff95b4de0685e6997d7533993c.
|
| |
|
|
|
|
| |
These give applications the option of more forcefully terminating client
connections for asyncio servers. Useful when terminating a service and
there is limited time to wait for clients to finish up their work.
|
| | |
|
| |
|
| |
Signed-off-by: cui fliter <imcusg@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
This makes the asyncio REPL (`python -m asyncio`) more usable
and similar to the regular REPL.
This exposes register_readline() as a top-level function in site.py,
but it's intentionally undocumented.
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Itamar Oren <itamarost@gmail.com>
|
| |
|
|
|
|
| |
Nothing else in Python generally logs the contents of variables, so this
can be very unexpected for developers and could leak sensitive
information in to terminals and log files.
|
| |
|
|
|
|
|
|
|
|
| |
In some cases we might cause a StreamWriter to stay alive even when the
application has dropped all references to it. This prevents us from
doing automatical cleanup, and complaining that the StreamWriter wasn't
properly closed.
Fortunately, the extra reference was never actually used for anything so
we can just drop it.
|
| |
|
|
| |
(#115622)
|
| |
|
|
| |
Also include the UDP packet header sizes (8 bytes per packet)
in the buffer size reported to the flow control subsystem.
|
| |
|
|
|
|
|
| |
create_datagram_endpoint() (#114893)
Also improve exception message.
Co-authored-by: Donghee Na <donghee.na92@gmail.com>
|
| |
|
|
|
| |
Task.cancel() (#112201)
Also did a general cleanup of asyncio locks.py comments and docstrings.
|
| | |
|
| | |
|
| |
|
|
|
| |
asyncio.BaseEventLoop.create_server() (GH-114420)
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
|
| |
|
| |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
Some of the asyncio SSL changes in GH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.
[1]: https://github.com/python/cpython/pull/31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0
|
| |
|
|
|
|
|
|
| |
block (GH-113819)
If other exception was raised during exiting an expired
asyncio.timeout() block, insert TimeoutError in the exception context
just above the CancelledError.
|
| |
|
|
|
|
| |
When an `StopIteration` raises into `asyncio.Future`, this will cause
a thread to hang. This commit address this by not raising an exception
and silently transforming the `StopIteration` with a `RuntimeError`,
which the caller can reconstruct from `fut.exception().__cause__`
|
| |
|
|
| |
timeout() (GH-113850)
|
| |
|
|
|
| |
asyncio.Condition.wait() (#111694)
Also fix a race condition in `asyncio.Semaphore.acquire()` when cancelled.
|
| |
|
|
| |
cancelled (#113690)
|
| |
|
|
|
|
|
|
|
|
| |
(#112803)
In case the spawned process is setuid, we may not be able to send
signals to it, in which case our .kill() call will raise
PermissionError.
Ignore that in order to avoid .close() raising an exception. Hopefully
the process will exit as a result of receiving EOF on its stdin.
|
| |
|
|
|
|
| |
When wrapped, `_SSLProtocolTransport._force_close(exc)` is called just like in the unwrapped scenario `_SelectorTransport._force_close(exc)` or `_ProactorBasePipeTransport._force_close(exc)` would be called, except here the exception needs to be passed through the `SSLProtocol._abort()` method, which didn't accept an exception object.
This commit ensures that this path works, in the same way that the uvloop implementation of SSLProto passes on the exception (on which the current implementation of SSLProto is based).
|
| | |
|
| |
|
| |
This affects task creation through either `asyncio.create_task()` or `TaskGroup.create_task()` -- the redundant call to `task.set_name()` is skipped. We still call `set_name()` when a task factory is involved, because the task factory call signature (unfortunately) doesn't take a `name` argument.
|
| |
|
|
|
|
| |
SelectorEventLoop (#112991)
_ensure_fd_no_transport had a KeyError in the success path
|
| |
|
|
|
|
|
| |
(#111983)
Issue a ResourceWarning instead.
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
| |
|
|
|
| |
Try to clean up the socket file we create so we don't add unused noise to the file system.
|
| |
|
|
|
| |
(#111601)
Call loop exception handler for exceptions in `client_connected_cb` of `asyncio.start_server` so that applications can handle it.
|