Yury Selivanov added the comment:
Just discussed this issue off-list with Nathaniel. Maybe this isn't as severe
as I thought it is.
If we cancel all asyncio tasks before calling `loop.shutdown_asyncgens()` this
*probably* becomes a non-issue. And "asyncio.run()" does just that
New submission from Yury Selivanov :
I believe I might have discovered a problem with asynchronous generators in 3.8.
# Prelude
In Python prior to 3.8 it was possible to overlap running of "asend()" and
"athrow()" methods for the same asynchronous generato
Change by Yury Selivanov :
--
nosy: -yselivanov
___
Python tracker
<https://bugs.python.org/issue32856>
___
___
Python-bugs-list mailing list
Unsubscribe:
Yury Selivanov added the comment:
Yes, docs updates sound good.
--
___
Python tracker
<https://bugs.python.org/issue38423>
___
___
Python-bugs-list mailin
Change by Yury Selivanov :
--
nosy: -yselivanov
___
Python tracker
<https://bugs.python.org/issue36356>
___
___
Python-bugs-list mailing list
Unsubscribe:
Yury Selivanov added the comment:
> In bpo-38392, I modified PyObject_GC_Track() in debug mode to detect this bug.
Awesome!!!
--
___
Python tracker
<https://bugs.python.org/issu
Yury Selivanov added the comment:
New changeset 321def805abc5b7c92c7e90ca90cb2434fdab855 by Yury Selivanov (Ben
Harper) in branch 'master':
bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)
https://github.com/python/cpython/commit/321def805abc5b7c92c7e90ca90cb2434fdab855
Yury Selivanov added the comment:
New changeset b23a8423a923077e4f83d3f328bb7542b4c940ed by Yury Selivanov
(idomic) in branch 'master':
bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)
https://github.com/python/cpython/commit/b23a8423a923077e4f83d3f328bb7542b4c940ed
Change by Yury Selivanov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Yury Selivanov added the comment:
> It seems like nobody came up with a solution for the debug mode since June. I
> close the issue. Reopen it if you would like to propose a solution.
I think the only solution is to have a flag to disable optimizations,
inlcluding th
Change by Yury Selivanov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Yury Selivanov added the comment:
New changeset 2f87a7dc5a1ad7f37787f0adee242c931643f878 by Yury Selivanov (Miss
Islington (bot)) in branch '3.8':
bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel
(GH-7468) (#16486)
https://github.com/python/cpython/commit
Yury Selivanov added the comment:
New changeset fc4a044a3c54ce21e9ed150f7d769fb479d34c49 by Yury Selivanov in
branch 'master':
bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel
(#7468)
https://github.com/python/cpython/commit
Yury Selivanov added the comment:
New changeset 1c19d656a79a00f58361ceb61c0a6d1faf90c686 by Yury Selivanov in
branch '3.8':
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
(#16485)
https://github.com/python/cpython/commit/1c19d656a79a00f58361ceb61c0a6d
Yury Selivanov added the comment:
I've reverted the code. Andrew, would really appreciate if you could quickly do
a post commit review.
--
stage: patch review -> commit review
___
Python tracker
<https://bugs.python.org/issu
Yury Selivanov added the comment:
New changeset 1c19d656a79a00f58361ceb61c0a6d1faf90c686 by Yury Selivanov in
branch '3.8':
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
(#16485)
https://github.com/python/cpython/commit/1c19d656a79a00f58361ceb61c0a6d
Change by Yury Selivanov :
--
pull_requests: +16071
pull_request: https://github.com/python/cpython/pull/16485
___
Python tracker
<https://bugs.python.org/issue36
Change by Yury Selivanov :
--
pull_requests: +16070
pull_request: https://github.com/python/cpython/pull/16485
___
Python tracker
<https://bugs.python.org/issue38
Yury Selivanov added the comment:
New changeset 6758e6e12a71ef5530146161881f88df1fa43382 by Yury Selivanov in
branch 'master':
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
https://github.com/python/cpython/commit/6758e6e12a71ef5530146161881f88
Yury Selivanov added the comment:
New changeset 6758e6e12a71ef5530146161881f88df1fa43382 by Yury Selivanov in
branch 'master':
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
https://github.com/python/cpython/commit/6758e6e12a71ef5530146161881f88
Change by Yury Selivanov :
--
pull_requests: +16066
pull_request: https://github.com/python/cpython/pull/16482
___
Python tracker
<https://bugs.python.org/issue38
Change by Yury Selivanov :
--
pull_requests: +16067
pull_request: https://github.com/python/cpython/pull/16482
___
Python tracker
<https://bugs.python.org/issue36
Yury Selivanov added the comment:
> Since this has been elevated to a release blocker, I wouldn't mind helping to
> revert this ASAP. I can open a PR to fix it today.
Sure, by all means, any help would be hugely appreciated. Thank you, Kyle.
You'll need to be careful to only revert t
Change by Yury Selivanov :
--
resolution: -> later
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue37141>
___
___
Python-bugs-
Yury Selivanov added the comment:
I already mentioned that in the PR, but we'll have to hit a pause on this. We
decided to revert the latest streams implementation from 3.8, see
https://bugs.python.org/issue38242. The upshot is that what we have in 3.9
should be more amenable for things
Yury Selivanov added the comment:
I slept on this and discussed this issue privately with a few non-involved
people who use asyncio daily.
My final opinion on this issue: we must revert the new streaming API from
asyncio and take our time to design it properly. I don't like what we have
Yury Selivanov added the comment:
> So like... both of these approaches are definitely possible, but to me it
> seems like if you look at it holistically, your approach is actually making
> the documentation and deprecations *more* complicated, not less.
I think Nathaniel might hav
Yury Selivanov added the comment:
Nathaniel, thanks for the summary!
A few comments to address some points:
> So Yury and I are tentatively thinking we'll make some kind of PEP for the
> 3.9 timescale, probably just for the core ABCs
Yes! At the very least for things like asynch
Change by Yury Selivanov :
--
nosy: +aeros167
___
Python tracker
<https://bugs.python.org/issue38260>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Yury Selivanov :
--
keywords: +patch
pull_requests: +15907
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16330
___
Python tracker
<https://bugs.python.org/issu
Yury Selivanov added the comment:
> The obvious fix would be to modify the 'except StopIteration' branch to
> handle this case by calling super().cancel() instead of
> super().set_exception(...).
Yeah, I think this is the solution we should
Yury Selivanov added the comment:
> Task group is another very required thing. If I choose between groups and
> steams I probably invest my time into the former.
We should get them in 3.9. I'm going to be working on the ExceptionGroup PEP
New submission from Yury Selivanov :
== Context
1. Andrew and I implemented a new streaming API in asyncio 3.8. The key idea
is that there's a single Stream object, combining old StreamReader &
StreamWriter APIs. On top of that, `Stream.write()` and `Stream.close()`
became corout
Yury Selivanov added the comment:
> If a python piece of code imports cython code with async defs,
> `asyncio.iscoroutinefunction` cannot determine that the code is async.
Well, this seems to be a regression. IIRC Cython used to emulate a Python code
object (__code__) for fun
Change by Yury Selivanov :
--
title: poloshing asyncio Streams API -> polishing asyncio Streams API
___
Python tracker
<https://bugs.python.org/issu
New submission from Yury Selivanov :
Summary of discussion at https://github.com/python-trio/trio/issues/1208:
* `asyncio.Stream.write()` will start throwing a `DeprecationWarning` asking
people to add an `await` if they didn't;
* `asyncio.Stream.close()` will start throwing
Yury Selivanov added the comment:
(copying my GitHub message on this topic from
https://github.com/python/cpython/pull/15889#issuecomment-530030002)
I thought we were going to be more subtle about this.
We have two scenarios:
1. Somebody creates an instance of asyncio.Lock outside
Yury Selivanov added the comment:
(copying my GitHub message on this topic from
https://github.com/python/cpython/pull/15889#issuecomment-530030002)
I thought we were going to be more subtle about this.
We have two scenarios:
Somebody creates an instance of asyncio.Lock outside
Change by Yury Selivanov :
--
Removed message: https://bugs.python.org/msg351728
___
Python tracker
<https://bugs.python.org/issue36373>
___
___
Python-bug
Yury Selivanov added the comment:
> it will help simplify some Mock things.
Yeah, we'll need to chat about that so I can use Mock requirements in the PEP.
:)
--
___
Python tracker
<https://bugs.python.org/issu
Yury Selivanov added the comment:
FWIW I've been using TaskGroups in EdgeDB codebase extensively:
https://github.com/edgedb/edgedb/blob/master/edb/common/taskgroup.py (you can
use the code, it's Apache 2)
The only thing that prevented us from merging them in 3.8 is that we need to
formally
Yury Selivanov added the comment:
We want to add TaskGroups to asyncio (a similar concept to Trio's nurseries).
TaskGroups use the `async with` statement to clearly define where Tasks are
created and at which point they are expected to be completed or destroyed.
asyncio.gather
Yury Selivanov added the comment:
BTW, if we are doing this -- maybe not expose the underlying transport at all?
I don't like that we do that currently, and there multiple ways for the user to
screw up the Stream object (and potentially break start_tls()/sendfile() etc
Yury Selivanov added the comment:
--
___
Python tracker
<https://bugs.python.org/issue33523>
___
___
Python-bugs-list mailing list
Unsubscribe:
Yury Selivanov added the comment:
> What do you think of the "shutdown_default_executor()" name?
Yeah, I think it's a better name!
--
___
Python tracker
<https://bugs.pytho
Yury Selivanov added the comment:
Here's the API I propose to solve this problem:
https://github.com/python/cpython/pull/15735#pullrequestreview-285389412
Summary:
* Add a new loop.shutdown_threadpool() method. Just like with
shutdown_asyncgens() -- it would be invalid to call
Yury Selivanov added the comment:
Andrew, can you fix ctrl-c/windows issue? I'm basically afk until monday.
And we're not going to do anything about add_signal_handler in 3.8.
--
___
Python tracker
<https://bugs.python.org/issue34
Yury Selivanov added the comment:
> I think a simple iscoroutinefunction check will be pretty close to 100%
> matching what users expect.
Yes, "pretty close", but not reliable. :) E.g. I can easily design a decorator
that when applied first would break the proposed isc
Yury Selivanov added the comment:
> I hear you on the semantic confusion, but is a single check at definition
> time really that expensive?
Do you know how to make that single check 100% reliable?
--
___
Python tracker
<https://bugs.p
Yury Selivanov added the comment:
+1 to what Ben said.
Andrew,
> The proposal looks like a very dirty hack and smells as it is.
I wonder why are you feeling like that about this idea. I don't think this is
a hack at all. There's no native API, so we're forced to use another appro
Yury Selivanov added the comment:
Andrew,
> Sorry, no. There is no way IIUC.
Well, in this case we should do that via a thread+select approach as I and Ben
suggested.
I can write some PoC code; will you have some time to polish it and commit it?
(I'm OOO and don't have a windows mach
Yury Selivanov added the comment:
Victor, Andrew,
I'm not an expert in IOCP, but is it possible to implement add_reader/writer in
ProactorEventLoop? If there's no native API for that, I guess we can spawn a
thread with a 'select()' call to emulate this API?
Lukasz,
Another question
Change by Yury Selivanov :
--
nosy: -yselivanov
___
Python tracker
<https://bugs.python.org/issue37213>
___
___
Python-bugs-list mailing list
Unsubscribe:
Yury Selivanov added the comment:
Yeah, we have the SSL reimplementation ready to be backported from uvloop to
cpython. Fantix, the original author, should be able to do that soon.
--
___
Python tracker
<https://bugs.python.org/issue37
Change by Yury Selivanov :
--
nosy: -yselivanov
___
Python tracker
<https://bugs.python.org/issue33694>
___
___
Python-bugs-list mailing list
Unsubscribe:
Yury Selivanov added the comment:
> Not sure if we have to drop this warning, it enforces writing good code that
> controls all created resources lifecycle.
Right, maybe we add "transport.terminate()" as well? Synchronously &
immediately closing a transport is a val
Yury Selivanov added the comment:
> Sorry, that's how asyncio is designed.
Andrew, couldn't we provide a "stream.terminate()" method (not a coroutine)
that would do the following:
* close the transport
* set a flag in the protocol that the stream has been terminated. When the
Yury Selivanov added the comment:
Eric, regarding signals no longer using pending calls -- interesting, I'll take
a look. Thanks for pointing this out.
Sent from my iPhone
--
___
Python tracker
<https://bugs.python.org/issue37
Yury Selivanov added the comment:
> As to exposing Py_AddPendingCall() as sys.addpendingcall, that might be
> opening a can of worms. Injecting code into the eval loop at some arbitrary
> ("soon") future time requires care and the code isn't well exercised
> h
New submission from Yury Selivanov :
When asyncio event loop is created in a non-main thread, it needs to initialize
a so called ChildWatcher for it (a helper object to intercept subprocesses
exits). Doing that requires to run code in the main thread.
I propose to add a 'sys.addpendingcall
Change by Yury Selivanov :
--
keywords: +patch
pull_requests: +13550
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/13656
___
Python tracker
<https://bugs.python.org/issu
Yury Selivanov added the comment:
> Yuri, I think we should deprecate explicit loop everywhere in non-deprecated
> asyncio API by Python 3.8.
+1
--
___
Python tracker
<https://bugs.python.org/i
Yury Selivanov added the comment:
> I suggest "Python asyncio REPL 3.8.0a4+ (...)". I prefer to keep "Python"
> somewhere.
Sure.
> Is "exiting asyncio REPL..." message really helpful? If exit can block, would
> it possible to only display a me
Change by Yury Selivanov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Yury Selivanov added the comment:
New changeset ff6b2e66b19a26b4c2ab57e62e1ab9f3d94dd76a by Yury Selivanov
(Xtreak) in branch 'master':
bpo-37047: Refactor AsyncMock setup logic for autospeccing (GH-13574)
https://github.com/python/cpython/commit/ff6b2e66b19a26b4c2ab57e62e1ab9f3d94dd76a
Yury Selivanov added the comment:
Done. 爛 we don't regret this.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Yury Selivanov added the comment:
New changeset 431b540bf79f0982559b1b0e420b1b085f667bb7 by Yury Selivanov in
branch 'master':
bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)
https://github.com/python/cpython/commit/431b540bf79f0982559b1b0e420b1b085f667bb7
Yury Selivanov added the comment:
The REPL has been merged to 3.8. It's not perfect though -- a ^C might break
the asyncio event loop, sometimes ^C stops working altogether. We'll
investigate all these issues in follow up PRs.
--
stage: patch review -> resolved
status: o
Yury Selivanov added the comment:
New changeset 16cefb0bc7b05c08caf08525398ff178c35dece4 by Yury Selivanov in
branch 'master':
bpo-37028: asyncio REPL; activated via 'python -m asyncio'. (GH-13472)
https://github.com/python/cpython/commit/16cefb0bc7b05c08caf08525398ff178c35dece4
Change by Yury Selivanov :
--
keywords: +patch
pull_requests: +13446
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue37028>
___
___
Py
New submission from Yury Selivanov :
Having an asyncio enabled repr where a top-level "await" possible would be a
huge productivity boost. Using asyncio.run() in a REPL is hard, and besides it
spawns a new event loop on every call.
The big idea: we want users to be
Change by Yury Selivanov :
--
keywords: +patch
pull_requests: +13444
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue37027>
___
___
Py
Change by Yury Selivanov :
--
components: +asyncio
nosy: +asvetlov
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issue37027>
___
___
Pytho
New submission from Yury Selivanov :
Currently asyncio exposes the underlying transport socket directly, providing a
way to modify (in a potentially disruptive way) the underlying transport
connection.
--
messages: 343332
nosy: yselivanov
priority: normal
severity: normal
status
Change by Yury Selivanov :
--
keywords: +patch
pull_requests: +13442
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32528>
___
___
Py
Yury Selivanov added the comment:
> And I'm guessing you will collect what's in NEWS.d ? Otherwise I'm happy to
> contribute some text. let me know the best way.
Would be great if you could make a PR to add an entry to whatsnew/3.8.rst (as
Victor su
Yury Selivanov added the comment:
> Would it be possible to document this change in What's New in Python 3.8?
Yes, Elvis and I will take care of that later.
--
___
Python tracker
<https://bugs.python.org/issu
Change by Yury Selivanov :
--
pull_requests: +13385
___
Python tracker
<https://bugs.python.org/issue34616>
___
___
Python-bugs-list mailing list
Unsubscribe:
Yury Selivanov added the comment:
I've no problem with this. We can add a 'get_coro()' Task method (this is in
line with asyncio usually having the "getter" api as opposed to properties).
--
___
Python tracker
<https://bugs.python.o
Change by Yury Selivanov :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue34616>
___
___
Yury Selivanov added the comment:
New changeset 565b4f1ac7304d1e690c404ca8316f383ba60862 by Yury Selivanov
(Matthias Bussonnier) in branch 'master':
bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)
https://github.com/python/cpython/commit
Yury Selivanov added the comment:
I'll be working on CPython on Friday. Will take a look at your PR first thing.
--
___
Python tracker
<https://bugs.python.org/issue34
Yury Selivanov added the comment:
If we're just calling socket.close(), then what's the point of waiting for
connection_lost? (I remember us discussing this, but I don't quite remember
the details).
Usually .abort() is a synchronous method, which kind of signals that "i want to
Yury Selivanov added the comment:
Here's a VERY rough first implementation to play with:
https://github.com/1st1/cpython/commit/ad2ed0aed922d7c36f2fced64264124613e37f09
--
___
Python tracker
<https://bugs.python.org/issue34
Yury Selivanov added the comment:
> No, I do not have a patch. I can provide a few test case
That would be helpful!
> and I am happy to spend some task to sit-down and discuss what we exactly do
> so far in IPython. I'm flying back Sunday morning.
Yes, let's do that around Friday
Yury Selivanov added the comment:
> Yeah, I think this is pretty simple: the runtime/stdlib should provide the
> primitives to compile top-level async code, get coroutines, etc., and then a
> REPL like ipython can take care of handing that off to asyncio or whatever
> libra
Yury Selivanov added the comment:
Absolutely. I think there's another open issue for this and I even have a dev
branch somewhere with this idea half implemented. Definitely something to have
in 3.8.
--
___
Python tracker
<ht
Yury Selivanov added the comment:
New changeset f683f464259715d620777d7ed568e701337a703a by Yury Selivanov
(Fantix King) in branch 'master':
bpo-34745: Fix asyncio sslproto memory issues (GH-12386)
https://github.com/python/cpython/commit/f683f464259715d620777d7ed568e701337a703a
Yury Selivanov added the comment:
> I guess it fails only for less difference in time like 0.01 and 0.001.
Yeah, that's what I was thinking. 0.1 seconds is still too tight, a simple GC
pause can skew the timers and break the test logic.
Maybe we should just increase the sleep to 0.5 o
Yury Selivanov added the comment:
Can you change "await asyncio.sleep(0.01)" to "await asyncio.sleep(1)" and
check if the test still fails? (IOW see if there's a bug in Python's async gen
implementation or this is simply ca
Yury Selivanov added the comment:
I also recommend reading this page
https://docs.python.org/3/library/asyncio-task.html to get a better grasp on
coroutines and how they are evaluated.
--
___
Python tracker
<https://bugs.python.org/issue30
Yury Selivanov added the comment:
There's no inconsistency here and the docs are correct.
If you have a function:
async def foo():
pass
Then "foo()" call returns a "coroutine", which is an awaitable. So
async def __aenter__():
...
always returns an a
Yury Selivanov added the comment:
Yes, I have exactly the same thoughts as Nathaniel about this. The bug should
be fixed, and the algorithm should be as follows (quoting Nathaniel):
> So, I would expect the rule to be, precisely: if an async list/dict/set
> comprehension occurs
Yury Selivanov added the comment:
> And the same tokenizer trick that detects 'async def' could detect 'async
> for' easily.
Exactly. I just never thought that we could support async generator
expressions with the kind of hacks in tokenizer we had in 3.5-3.6. FWIW I
still b
Yury Selivanov added the comment:
> But why would we? I already have a working solution.
I've heard some complaints that it's hard to migrate to Python 3.7 because
async and await are keywords (although I think by now all popular libraries
have migrated already), so in case you e
Yury Selivanov added the comment:
Actually, I think we could revert to old lexer hacks in 3.8 if we modify them
to treat 'async for' tocken sequence as one meta-tocken.
--
___
Python tracker
<https://bugs.python.org/issue35
Yury Selivanov added the comment:
Well, it's not just rolling back async/await from being keywords. Since 3.7
it's possible to create async generator expressions in non-async functions.
This wasn't possible to do with old hacks on the lexer. So if you want to
revert the change you risk
Yury Selivanov added the comment:
>> There's no clear reason to complicate the Task<->coroutine relationship by
>> allowing to inject arbitrary exceptions into running coroutines.
> My comment was more about CancelledError rather than arbitrary exceptions.
> You
Yury Selivanov added the comment:
> One reason why Task.cancel() is an incomplete replacement for
> Task.set_exception() is that you don't have an easy way to communicate why
> the task was ended.
The result of the Task is bound to the result of the coroutine it wraps. If
the
Yury Selivanov added the comment:
This is a backwards incompatible change, unfortunately. Wait for the new
TaskGroups API that will resolve this issue.
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
_
201 - 300 of 3072 matches
Mail list logo