Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
I personally don't think that the described opt-in trick should be a part of
asyncio.
A third-party library that patches asyncio.create_task() can be a useful thing
though during the transition period.
We even cannot deprecate asyncio.create_task() right now
Andrew Svetlov added the comment:
-1
Now bare `create_task()` does fire-and-forget action.
After the proposed change it will fail loudly.
Even if this behavior is better it is not backward compatible.
People start blaming and asking "how to return everything
Andrew Svetlov added the comment:
Clear, thanks!
--
___
Python tracker
<https://bugs.python.org/issue46771>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andrew Svetlov added the comment:
I have no good simple real-case scenario, sorry.
There is a demonstration of my thoughts.
Suppose we have a custom context manager that behaves similar to timeout() but
is controlled not by timer but external event source (it could be an
invalidation
Andrew Svetlov added the comment:
Serhiy is right, Condition.wait() has the following code:
finally:
# Must reacquire lock even if wait is cancelled
cancelled = False
while True:
try:
await self.acquire
Andrew Svetlov added the comment:
Thanks, Raymond.
I agree that caching of iterators and generators is out of the issue scope.
Also, I agree that a separate async cache decorator should be added. I prefer
the `async_lru_cache` (and maybe `async_cache` for the API symmetry). We have
Andrew Svetlov added the comment:
If some code is used together with timeout() and this code calls `.cancel()`
but forgot about `.uncancel()` in try/except/finally -- timeout() never raises
TimeoutError.
Should we care? The missing `.uncancel()` call is hard to detect by the runtime
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue46522>
___
___
Change by Andrew Svetlov :
--
versions: -Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.org/issue46522>
___
___
Python-bugs-list mailin
Andrew Svetlov added the comment:
New changeset 9b12b1b803d7b73640ab637a74a6f35f3fe9db21 by Thomas Grainger in
branch 'main':
bpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887)
https://github.com/python/cpython/commit/9b12b1b803d7b73640ab637a74a6f35f3fe9db21
Andrew Svetlov added the comment:
Deprecation is a good answer.
Let's not forget to apply it to 3.11 then.
--
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
Sorry, that's how asyncio works: it never switches to another task if `await
...` doesn't need to wait for something actually.
Adding `await asyncio.sleep(0)` to every call decreases performance.
--
resolution: -> wont fix
stage: patch rev
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Andrew Svetlov :
--
assignee: -> asvetlov
___
Python tracker
<https://bugs.python.org/issue44886>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Andrew Svetlov :
--
versions: +Python 3.10, Python 3.11 -Python 3.8
___
Python tracker
<https://bugs.python.org/issue44886>
___
___
Python-bugs-list m
Change by Andrew Svetlov :
--
keywords: +patch
pull_requests: +29639
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31512
___
Python tracker
<https://bugs.python.org/issu
New submission from Andrew Svetlov :
Suppose multiple `task.cancel(msg)` with different messages are called on the
same event loop iteration.
What message (`cancel_exc.args[0]`) should be sent on the next loop iteration?
As of Python 3.10 it is the message from the *last* `task.cancel(msg
Andrew Svetlov added the comment:
Sorry, your use-case looks not convincing but overcomplicated.
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset 8fb94893e4a870ed3533e80c4bc2f1ebf1cfa9e7 by Thomas Grainger in
branch 'main':
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
https://github.com/python/cpython/commit/8fb94893e4a870ed3533e80c4bc2f1ebf1cfa9e7
Change by Andrew Svetlov :
--
title: Support decorating a coroutine with functools.cached_property ->
Support decorating a coroutine with functools.lru_cache
___
Python tracker
<https://bugs.python.org/issu
Andrew Svetlov added the comment:
> Are you suggesting that I need to just inherit from Awaitable?
Yes. Awaitable is a very base protocol, Coroutine is an implementation.
`__await__` returns a generator that is used by Python internals as if `yield
from awaitable.__await__()` was cal
Andrew Svetlov added the comment:
Could you provide more context for the proposed change?
--
___
Python tracker
<https://bugs.python.org/issue46824>
___
___
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset 4140bcb1cd76dec5cf8d398f4d0e86c438c987d0 by Andrew Svetlov in
branch 'main':
bpo-45390: Propagate CancelledError's message from cancelled task to its
awaiter (GH-31383)
https://github.com/python/cpython/commit
Andrew Svetlov added the comment:
You don't need send()/throw()/close() methods.
aiohttp had them to work with Python 3.5
P.S. Please don't use the bug tracker as Q site.
--
resolution: -> not a bug
stage: -> resolved
status: open -&g
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset 195a46d6ffd4cec6c5fb69c5890f8b1758ac91ca by Serhiy Storchaka in
branch 'main':
bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431)
https://github.com/python/cpython/commit/195a46d6ffd4cec6c5fb69c5890f8b
Andrew Svetlov added the comment:
Sorry, I was not clear maybe.
Newly added methods can have a `flag` argument from the very beginning.
Adding a flag to already existing methods requires a separate issue.
--
___
Python tracker
<ht
Andrew Svetlov added the comment:
> This should be solved when using the cancel count -- the explicit cancel
> bumps the cancel count so the cancel scope (i.e. timeout()) will not raise
> TimeoutError.
Hmmm. Interesting!
Timeouts are not the single primitive that should c
Andrew Svetlov added the comment:
Alex, the 'scope' argument can be added if it is really required.
I'm not sure if the nonce is unavoidable still.
--
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
Updated https://github.com/python/cpython/pull/31394 demonstrated the approach
with global dict for counters.
--
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
In docs we can explain the behavior as "the outer expired timeout cancels the
inner waiter, waits for CancelError bubbling up, and raising TimeoutError
instead".
I agree that a counter is required for this behavior.
An alternative implementati
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11, Python 3.9
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset f1916cde24053f4c8b6799730666d19474f8dd09 by Miss Islington (bot)
in branch '3.10':
bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187)
(GH-31440)
https://github.com/python/cpython/commit
Andrew Svetlov added the comment:
Suppose we have a case when two nested timeouts are reached at the same event
loop iteration:
async def asyncio.timeout(1) as cm1:
async with third_party_cm() as cm2:
async def asyncio.timeout(1) as cm3:
async with third_party_cm
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset a6116a980c9eae91c2f9af7cbd0a9727e9b887ba by Andrew Svetlov in
branch '3.9':
[3.9] bpo-46672: fix `NameError` in `asyncio.gather` if type check fails
(GH-31187) (GH-31441)
https://github.com/python/cpython/commit
Change by Andrew Svetlov :
--
pull_requests: +29575
pull_request: https://github.com/python/cpython/pull/31444
___
Python tracker
<https://bugs.python.org/issue46
Change by Andrew Svetlov :
--
pull_requests: +29574
pull_request: https://github.com/python/cpython/pull/31443
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
The issue can be backported.
It doesn't change existing behavior but raises a better error.
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Andrew Svetlov :
--
versions: +Python 3.9
___
Python tracker
<https://bugs.python.org/issue46252>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andrew Svetlov added the comment:
A separate issue for 'flags' adding looks better. The reason for missing is an
oversight I think.
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Andrew Svetlov :
--
pull_requests: +29573
pull_request: https://github.com/python/cpython/pull/31442
___
Python tracker
<https://bugs.python.org/issue46
New submission from Andrew Svetlov :
SSLSocket is a blocking object by definition, it is not compatible with asyncio.
asyncio has a check for SSLSocket in sock_*() operations, it should be extended
to transport-based API
--
title: SSLWantReadError causes _SelectorSocketTransport
Change by Andrew Svetlov :
--
pull_requests: +29572
pull_request: https://github.com/python/cpython/pull/31441
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
New changeset 4ab8167b9c60d1a04b2e3116d0c52db254b68cda by Nikita Sobolev in
branch 'main':
bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187)
https://github.com/python/cpython/commit/4ab8167b9c60d1a04b2e3116d0c52db254b68cda
Andrew Svetlov added the comment:
New changeset e7130c2e8c6abfaf04b209bd5b239059eda024b9 by Andrew Svetlov in
branch 'main':
bpo-46752: Uniform TaskGroup.__repr__ (GH-31409)
https://github.com/python/cpython/commit/e7130c2e8c6abfaf04b209bd5b239059eda024b9
Change by Andrew Svetlov :
--
pull_requests: +29550
pull_request: https://github.com/python/cpython/pull/31409
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
> the third case the behavior is wrong, the `.cancel()` should win over the
> timeout. Otherwise using the context manager becomes too risky in real-world
> situations.
Please elaborate. The first code that calls `.cancel()` wins, doesn't mat
Andrew Svetlov added the comment:
Guido, the third case:
The third edge case is: explicit cancel() happened *after* the timeout (but
still in the
same iteration)?
timeout current-iteration (calls .cancel() after timeout) next-iteration
Andrew Svetlov added the comment:
> 6. The loop parameter of Task() was documented as both removed and required
> (if there is no current event loop) in 3.10.
I think we should drop Task() constructor definition from Task Object docs
https://docs.python.org/3/library/asyncio-task.htm
Andrew Svetlov added the comment:
I have a feeling that we need a low-level API section that describes
*supported* API that is intended to task extenders only (guys who want to
provide an alternative task factory for example).
I love to contribute but not sure when I can find time
Andrew Svetlov added the comment:
The PR is pretty empty, it has a scaffolding for `asyncio.timeouts` module and
its test only. I'll try to add something real tomorrow.
My plan is:
- solve 'easy' questions with Tin during PR's discussion/reviews
- make something that we are both agree
Andrew Svetlov added the comment:
https://github.com/python/cpython/pull/31394 is created for collaboration , Tin
Tvrtković is invited.
Core devs should have the write access already.
Non-core devs, please ask for github invite if you want to collaborate
Change by Andrew Svetlov :
--
pull_requests: +29539
pull_request: https://github.com/python/cpython/pull/31394
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
I support Alex Grönholm: TaskGroup is not affected by cancellation races
because it doesn't convert the exception or swallows it.
The code is safe from my understanding.
--
___
Python tracker
<ht
Andrew Svetlov added the comment:
The discussion is hot, I see several interleaved threads.
Let me put my answers on all of them in order of appearance.
1. quattro cancellation scopes are implemented after async-timeout.
As the author of async-timeout I am happy to know it.
The module
Andrew Svetlov added the comment:
After TaskGroup merging, the second `cancel()` call returns `False` and doesn't
initiate the actual cancellation if it was scheduled by the first `cancel()`
call.
I believe it "fixes" async-timeout: the first canc
Andrew Svetlov added the comment:
User code should not create Task objects explicitly.
Please use `asyncio.create_task()` (or shiny new TaskGroup.create_task())
instead. They doesn't have 'loop' argument.
--
___
Python tracker
<ht
Andrew Svetlov added the comment:
I have a pull request for the issue.
It doesn't use `Future.set_exception()` but creates a new CancelledError() with
propagated message.
The result is the same, except raised exceptions are not comparable by `is`
check.
As a benefit, `_cancelled_exc` works
Change by Andrew Svetlov :
--
keywords: +patch
pull_requests: +29531
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31383
___
Python tracker
<https://bugs.python.org/issu
Change by Andrew Svetlov :
--
versions: +Python 3.11 -Python 3.9
___
Python tracker
<https://bugs.python.org/issue45390>
___
___
Python-bugs-list mailin
Andrew Svetlov added the comment:
Please check against the latest master.
It has rewritten SSL protocol implementation borrowed from uvloop.
See #44011 for details
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset 72c46462aa9fd0a69317917ba127e62f94ce08d7 by Miss Islington (bot)
in branch '3.10':
bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (GH-31327)
(GH-31362)
https://github.com/python/cpython/commit
Andrew Svetlov added the comment:
New changeset 1d81fdc4c004511c25f74db0e04ddbbb8a04ce6d by Alex Waygood in
branch 'main':
bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327)
https://github.com/python/cpython/commit/1d81fdc4c004511c25f74db0e04ddbbb8a04ce6d
Change by Andrew Svetlov :
--
priority: critical -> normal
___
Python tracker
<https://bugs.python.org/issue44011>
___
___
Python-bugs-list mailing list
Un
Andrew Svetlov added the comment:
The code had landed.
Need a follow-up PR with documentation update (mention new ssl_shutdown_timeout
arguments)
--
___
Python tracker
<https://bugs.python.org/issue44
Andrew Svetlov added the comment:
New changeset 13c10bfb777483c7b02877aab029345a056b809c by Kumar Aditya in
branch 'main':
bpo-44011: New asyncio ssl implementation (#31275)
https://github.com/python/cpython/commit/13c10bfb777483c7b02877aab029345a056b809c
Andrew Svetlov added the comment:
>From my point of view, both sync and async functions can be cached.
Sync and async iterators/generators are other beasts: they don't return a value
but generate a series of items. The series can be long and memory-consuming, I
doubt if it should be cac
Andrew Svetlov added the comment:
Agree. Let's start from async functions support by `functools.lru_cache`.
If we will have an agreement that cached_property is an important use-case we
can return to this issue.
I have a feeling that async lru_cache is much more important.
https
Andrew Svetlov added the comment:
Alex, you are right. BufferedProtocol is considered stable since 3.8
A pull request with docstring fix is welcome.
--
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
I have a design question.
Does `print(await a.hello)` look awkward?
I'm not speaking about correction.
In asyncio code I have seen before, `await val` means waiting for a future
object. `await func()` means async function call.
`await obj.attr` looks more
Andrew Svetlov added the comment:
Closed.
Thanks for the reminder!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Andrew Svetlov :
--
versions: +Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.org/issue46708>
___
___
Python-bugs-list mailin
Change by Andrew Svetlov :
--
pull_requests: +29424
pull_request: https://github.com/python/cpython/pull/31256
___
Python tracker
<https://bugs.python.org/issue46
Change by Andrew Svetlov :
--
pull_requests: +29423
pull_request: https://github.com/python/cpython/pull/31255
___
Python tracker
<https://bugs.python.org/issue46
Change by Andrew Svetlov :
--
keywords: +patch
pull_requests: +29421
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31253
___
Python tracker
<https://bugs.python.org/issu
Andrew Svetlov added the comment:
Thanks for the report!
Let me make a fix PR in a few minutes
--
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
You can return a wrapper from __get__ that awaits the inner function and saves
the result somewhere.
--
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
Pull Request is welcome!
I would say that the PR should not use asyncio directly but 'async def',
'await', and `inspect.iscoroutine()` / `inspect.iscoroutinefunction()` instead.
The property should work with any async framework, not asyncio only
Andrew Svetlov added the comment:
The change should NOT be backported, it doesn't fix any bug but clears code a
little
--
versions: -Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.org/issue46
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset 3483aa65dfebfc60a87ea9db3f20da84be41f606 by Nikita Sobolev in
branch 'main':
bpo-46583: remove unused `sys.version_info` check from `selectors` (GH-31023)
https://github.com/python/cpython/commit/3483aa65dfebfc60a87ea9db3f20da84be41f606
Andrew Svetlov added the comment:
Done, thanks!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
New changeset 64568acbd88a88d54ac9b8215447f88280448dd5 by Emiya in branch
'main':
bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol transports
(GH-30958)
https://github.com/python/cpython/commit/64568acbd88a88d54ac9b8215447f88280448dd5
Change by Andrew Svetlov :
--
versions: -Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue46487>
___
___
Python-bugs-list mailin
Andrew Svetlov added the comment:
I guess if you are asking for initialization and finalization of
thread-specific data in a thread pool -- you need exactly these things (or a
context manager).
A custom thread class reveals too many implementation details.
I personally prefer an explicit
Andrew Svetlov added the comment:
You are welcome!
--
___
Python tracker
<https://bugs.python.org/issue46568>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Andrew Svetlov :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
Your version works but can be simplified.
Just use
await writer.drain()
writer.write(data)
without grabbing the drainer early.
The purpose of the .drain() method is to write pausing if the write buffer side
is greater than the high watermark
Andrew Svetlov added the comment:
Your code has at least one concurrency problem. Let's look back at
forward_stream() function:
async def forward_stream(reader: StreamReader, writer: StreamWriter, event:
asyncio.Event, source: str):
writer_drain = writer.drain() # <--- awaita
Andrew Svetlov added the comment:
Sorry, I didn't look into docs before writing.
Now we have an interesting situation: the documentation reflects the desired
state already but the code is not :)
The PR should contain fixes for transports.py and sslproto.py only (plus a
blurb record for NEWs
Andrew Svetlov added the comment:
Please feel free to propose pull request for documentation tuning.
--
___
Python tracker
<https://bugs.python.org/issue34
Andrew Svetlov added the comment:
Forgot to write, after making the method public we can implement it in SSL
transport easily.
--
___
Python tracker
<https://bugs.python.org/issue46
Andrew Svetlov added the comment:
Technically it should not provide the method according to the current design.
get_write_buffer_limits() is not a part of public transports API, this method
is defined by private class _FlowControlMixin only.
WriteTransport requires only get_write_buffer_size
201 - 300 of 4954 matches
Mail list logo