Andrew Svetlov added the comment:
ThreadedChildWatcher starts a thread per process but has O(1) complexity.
MultiLoopChildWatcher doesn't spawn threads, it can be used safely with asyncio
loops spawn in multiple threads. The complexity is O(N) plus no other code
should contest for SIG
Andrew Svetlov added the comment:
My non-LTS Ubuntu also has 5.3 kernel but I'm talking about the oldest
supported RHEL/CentOS.
That's why pidfd_open() cannot be a single implementation. It's so new; my
local man-pages system has not a record about the API yet (but the web ha
Andrew Svetlov added the comment:
I think we can add `DeprecationWarning` for 3.9.
Since it is a) just a warning b) already marked as deprecated in docs -- the
harm is minimal.
Honestly, we just missed the issue when were prepared for 3.8
New submission from Andrew Svetlov :
Consider the following code:
import asyncio
q = asyncio.Queue()
async def main():
await asyncio.gather(q.put(1), q.get(1))
asyncio.run(main())
This code just hangs since run() creates a loop but queue is bound with another
(default) event loop
Andrew Svetlov added the comment:
> If we add the deprecation warning just for 3.9, would the removal release
> also be pushed forward?
Yes, deprecating in 3.9 with removal in 3.11 is fine.
Regarding 3.8 release notes update -- not sure if it is needed flr docs-only
change.
Andrew Svetlov added the comment:
Please do.
--
___
Python tracker
<https://bugs.python.org/issue38314>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andrew Svetlov added the comment:
lgtm
--
___
Python tracker
<https://bugs.python.org/issue34790>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andrew Svetlov added the comment:
At least it is my learned lesson from aiohttp development.
--
___
Python tracker
<https://bugs.python.org/issue38599>
___
___
Andrew Svetlov added the comment:
I have a different feeling: we should start raising deprecation for
asyncio.Queue() if it is created without running event loop.
It required `get_event_loop()` and `loop.is_running()` checks.
Later the pair can be replaced with `get_running_loop()`.
I
Andrew Svetlov added the comment:
This print comes from asyncio debug mode when async function is blocked by time
longer than 0.1 sec (see loop.slow_callback_duration at
loop.slow_callback_duration).
Usually, it is a sign of a problem in user code, e.g. something should be
pushed into
Andrew Svetlov added the comment:
I think it should be closed; Yuri thinks that current streams API is frozen for
the sake of shiny brand new streams (don't exist yet).
--
resolution: -> wont fix
status: open -> closed
___
Python trac
Andrew Svetlov added the comment:
I'm pretty happy with asyncio.run() functionalit.
I used run() for the bug demonstration, but the example can be rewritten easily
without this function.
The problem is not in run() but in an object lifecycle. Implicit loop creation
plus module-
Change by Andrew Svetlov :
--
components: +asyncio
nosy: +yselivanov
___
Python tracker
<https://bugs.python.org/issue38608>
___
___
Python-bugs-list mailin
Andrew Svetlov added the comment:
Well, if the reported line is invalid it should be fixed
--
___
Python tracker
<https://bugs.python.org/issue38608>
___
___
Andrew Svetlov added the comment:
`run` should be awaitable method, see #38430
--
___
Python tracker
<https://bugs.python.org/issue32309>
___
___
Python-bug
Andrew Svetlov added the comment:
Paul's version looks better.
Two notes:
1. get_running_loop() should be used instead of get_event_loop()
2. There is no `await executer.shutdown()` API, the method is synchronous.
--
___
Python tracker
&
Andrew Svetlov added the comment:
What patch are you talking about?
For me, patch means something special; e.g. working fork of CPython where the
proposed idea is implemented.
I read await coro()[key] as
1. Function named coro() returns a dict-like object
2. An element under key is selected
Andrew Svetlov added the comment:
I thought about returning a special subclass.
Future has too rich API: get_loop(), done(), result() etc.
What's about returning the proxy object with future instance embedded; the
object raises DeprecationWarning for everythin except __repr__, __del_
Andrew Svetlov added the comment:
The API exists, people use it and get the memory leak.
We should either remove the API (not realistic dream at least for many years)
or fix it. There is no choice actually.
--
___
Python tracker
<ht
Andrew Svetlov added the comment:
IOCTL_AFD_POLL looks interesting.
I wonder if it is 100% reliable; we can miss some edge case easily.
--
___
Python tracker
<https://bugs.python.org/issue37
Andrew Svetlov added the comment:
For each type, we need at least a test that creates a socket pair and
successfully transfers data through the wire.
I don't know what additional things are required. For example, on reading about
SOCK_SEQ_PACKET I've found that recvmsg()
Andrew Svetlov added the comment:
How to get the message boundary without recvmsg()? Sorry, I'm not familiar with
seqpacket.
--
___
Python tracker
<https://bugs.python.org/is
Andrew Svetlov added the comment:
Another question: does SSL/TLS make sense for seqpacket?
--
___
Python tracker
<https://bugs.python.org/issue38285>
___
___
Andrew Svetlov added the comment:
At first, would be nice to figure out what "invalid line reported" does mean.
What text is reported and what is expected?
--
___
Python tracker
<https://bugs.python.o
Andrew Svetlov added the comment:
Can recv() get two messages at once?
What is the behavior if the buffer size passed into recv() is smaller than the
message length?
--
___
Python tracker
<https://bugs.python.org/issue38
Andrew Svetlov added the comment:
Awesome!
I think the patch can be splitted in os.pidfd_open() and asyncio part itself.
os modification is clear.
asyncio part looks correct after the brief view.
My the main question is: how to detect if the new watcher can be used or
asyncio should
Andrew Svetlov added the comment:
Nathaniel, you may be interested in the pidfd_open(), at least in adding the
function to os module.
--
nosy: +njs
___
Python tracker
<https://bugs.python.org/issue38
Andrew Svetlov added the comment:
My point is: without a deep understanding we cannot "just enable" a new
protocol.
The evidence that it works in some limited scenarios is not enough for opening
the can of worms.
It is true for seqpacket, and especially true for other even not
Andrew Svetlov added the comment:
Thanks for the clarification.
I forgot about this thing; the output can be improved sure.
As a workaround you can use the following hack::
import asyncio.task
asyncio.task.Task = asyncio.task._PyTask
IIRC the pure python version prints a coroutine name at
Andrew Svetlov added the comment:
I've assigned myself to never forget about the issue; if somebody wants to fix
_CTask and TaskWakeupMethWrapper representation -- you are welcome
--
assignee: -> asvetlov
___
Python tracker
Andrew Svetlov added the comment:
StreamReaderProtocol is tightly coupled with builtin asyncio transports.
Even worse, it is an internal class actually.
If you want a code to operate with custom transports -- perhaps you need to
reimplement streams for them as well.
--
resolution
Andrew Svetlov added the comment:
Slower by percents, not in the factor of times.
I guess for tests it is satisfactory.
--
___
Python tracker
<https://bugs.python.org/issue38
Andrew Svetlov added the comment:
1. Please consider `await` as a 'yield point': the point where the current task
may be suspended to get other tasks a chance to be executed.
It can be any `await`, not necessarily waiting for a task. Just a point where
asyncio event loop gives a
Andrew Svetlov added the comment:
Thanks for the reminder.
You are correct, the mentioned PR should set
_SSLProtocolTransport._start_tls_compatible to True
--
___
Python tracker
<https://bugs.python.org/issue37
New submission from Andrew Svetlov :
There is a PR created a long time ago.
Finally, I've ported tests for it also.
The documentation doesn't mention new ssh_shutdown_timeout parameter yet.
The latest changes from https://github.com/MagicStack/uvloop/pull/385 can be
applied
Change by Andrew Svetlov :
--
keywords: +patch
pull_requests: +24507
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17975
___
Python tracker
<https://bugs.python.org/issu
Andrew Svetlov added the comment:
New changeset 5fb06edbbb769561e245d0fe13002bab50e2ae60 by Andrew Svetlov in
branch 'master':
bpo-44011: New asyncio ssl implementation (#17975)
https://github.com/python/cpython/commit/5fb06edbbb769561e245d0fe13002b
Change by Andrew Svetlov :
--
pull_requests: +24526
pull_request: https://github.com/python/cpython/pull/25842
___
Python tracker
<https://bugs.python.org/issue44
Change by Andrew Svetlov :
--
pull_requests: +24529
pull_request: https://github.com/python/cpython/pull/25846
___
Python tracker
<https://bugs.python.org/issue44
Change by Andrew Svetlov :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue41756>
___
___
Pyth
Change by Andrew Svetlov :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
I'm not convinced why @task decorator should be a part of asyncio.
You can provide the implementation as a part of some third-party library on
pypy.org. Looks like it doesn't require any change of asyn
Andrew Svetlov added the comment:
asyncio provides the preemptive concurrency, not the real-time one.
It means that the exact time of task switches depends on other tasks' execution
and can vary by design.
Sorry, the jitter is unavoidable.
--
resolution: -> wont f
Andrew Svetlov added the comment:
I guess the fix requires switching C Extension types from static to heap for
_asyncio module.
It is possible for sure but requires a non-trivial amount of work.
We need a champion for the issue.
--
___
Python
Andrew Svetlov added the comment:
Thanks, guys!
--
___
Python tracker
<https://bugs.python.org/issue45416>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 don't think that we need to change something with the current behavior.
It exists for years; very many Python exceptions return an empty string on
`str(exc)` but return something useful on `repr(exc)`.
If you arguing to change the behavior -- all
Andrew Svetlov added the comment:
As people write above, Python supports multiple async frameworks, asyncio is
not the single choice.
You should select and maybe configure the async framework before executing your
first `await` statement.
That's why the proposal doesn't work
Andrew Svetlov added the comment:
Tornado solution sounds weak; it can fail the server start if free ports are
available.
I concur with Eric, I'm not aware of an OS API call that binds both IPv4 and
IPv6 to the same random port.
--
___
P
Andrew Svetlov added the comment:
PR for documentation fix is appreciated.
Random fails to bind the same port if free ports are available is kind of
regression.
Is tornado the only example or you are aware of other libraries with such
behavior
Andrew Svetlov added the comment:
> One concern I have is when users follow internet examples and look out
for these modules or examples.
There is an option: keep removed modules but replace each module content
with 'raise ImportError("Please use instead")' stub.
Th
Andrew Svetlov added the comment:
New changeset e501d70b347c5093018d12482c30a7a98aab86d0 by Hynek Schlawack in
branch 'main':
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533)
https://github.com/python/cpython/commit/e501d70b347c5093018d12482c30a7a98aab86d0
Andrew Svetlov added the comment:
New changeset 628667ac9a634c7a7fa7f681dd2f98ff5841c843 by Miss Islington (bot)
in branch '3.10':
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533) (GH-29535)
https://github.com/python/cpython/commit/628667ac9a634c7a7fa7f681d
Andrew Svetlov added the comment:
New changeset 8b6a474071bcc88ec3453e16f079181e551513c3 by Miss Islington (bot)
in branch '3.9':
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533) (GH-29536)
https://github.com/python/cpython/commit/8b6a474071bcc88ec3453e16f
Andrew Svetlov added the comment:
New changeset 4c792f39e688b11c7c19e411ed4f76a7baa44638 by Hong Xu in branch
'main':
bpo-45772: socket.socket should be a class instead of a function (GH-23960)
https://github.com/python/cpython/commit/4c792f39e688b11c7c19e411ed4f76
Andrew Svetlov added the comment:
New changeset b7360ae395e9e633d384d16064c5dc04a9841e19 by M. Mostafa Farzan in
branch 'main':
bpo-45752: Fix no-support examples in 'copy' docs (GH-29548)
https://github.com/python/cpython/commit/b7360ae395e9e633d384d16064c5dc04a9841e
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 15409c720be0503131713e3d3abc1acd0da07378 by Emmanuel Arias in
branch 'main':
bpo-28806: Continue work: improve the netrc library (GH-26330)
https://github.com/python/cpython/commit/15409c720be0503131713e3d3abc1acd0da07378
-
Change by Andrew Svetlov :
--
versions: +Python 3.11 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue28806>
___
___
Python-bugs-list mailin
Andrew Svetlov added the comment:
You are correct, the first statement is outdated.
Please feel free to make a pull request.
--
___
Python tracker
<https://bugs.python.org/issue45
Change by Andrew Svetlov :
--
nosy: +asvetlov
nosy_count: 3.0 -> 4.0
pull_requests: +28016
pull_request: https://github.com/python/cpython/pull/29779
___
Python tracker
<https://bugs.python.org/issu
Andrew Svetlov added the comment:
Typing for stdlib is provided by https://github.com/python/typeshed
CPython policy discourages embedded typing declarations.
--
nosy: +asvetlov
resolution: -> rejected
stage: patch review -> resolved
status: open -&g
Andrew Svetlov added the comment:
New changeset 52d10f6485a168141e7a50d68f9a9566fdd8379d by Andrew Svetlov in
branch '3.10':
[3.10] bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151)
(GH-29779)
https://github.com/python/cpyt
Change by Andrew Svetlov :
--
versions: +Python 3.11
___
Python tracker
<https://bugs.python.org/issue45568>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 46c8d915715aa2bd4d697482aa051fe974d440e1 by 180909 in branch
'main':
bpo-19460: Add test for MIMENonMultipart (GH-29817)
https://github.com/python/cpython/commit/46c8d915715aa2bd4d697482aa051fe974d440e1
--
nosy:
Andrew Svetlov added the comment:
New changeset 2c398a5acf85d1bbc5796f3385972d0759b90e54 by Miss Islington (bot)
in branch '3.10':
[3.10] bpo-19460: Add test for MIMENonMultipart (GH-29817) (GH-29818)
https://github.com/python/cpython/commit/2c398a5acf85d1bbc5796f3385972d
Andrew Svetlov added the comment:
New changeset 209cec8a2a2e845df5af764a9171af05a2a4c8e3 by Miss Islington (bot)
in branch '3.9':
[3.9] bpo-19460: Add test for MIMENonMultipart (GH-29817) (#29819)
https://github.com/python/cpython/commit/209cec8a2a2e845df5af764a9171af
Andrew Svetlov added the comment:
New changeset 934a82623793e9d52b85f74d5395d65927a52205 by Sam Bull in branch
'main':
bpo-37658: Actually return result in race condition (GH-29202)
https://github.com/python/cpython/commit/934a82623793e9d52b85f74d5395d6
Andrew Svetlov added the comment:
Thanks for the report.
Atomic copy (`list(self.processes.values()`) should fix the bug, sure.
I doubt if writing a reliable test for this situation is possible;
multithreading is hard.
I think we can accept a patch without a test but with an inline comment
Change by Andrew Svetlov :
--
assignee: -> asvetlov
___
Python tracker
<https://bugs.python.org/issue43498>
___
___
Python-bugs-list mailing list
Unsubscrib
Andrew Svetlov added the comment:
New changeset 7431448b817d3bf87f71661cf8f3d537807ab2e2 by Jakub KulĂk in branch
'main':
bpo-43498: Fix dictionary iteration error in _ExecutorManagerThread (GH-24868)
https://github.com/python/cpython/commit/7431448b817d3bf87f71661cf8f3d5
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
versions: +Python 3.10, Python 3.9
___
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 99a9b343316172f049a52b39a406f0c0c42c106f by Miss Islington (bot)
in branch '3.9':
bpo-37658: Actually return result in race condition (GH-29202) (GH-29832)
https://github.com/python/cpython/commit/99a9b343316172f049a52b39a406f0
Andrew Svetlov added the comment:
IMHO, asyncio.set_event_loop() and
policy.get_event_loop()/policy.set_event_loop() are not deprecated by oversight.
In IPython, I think you could use new_event_loop() for getting a new loop
instance.
Then, save the loop reference somewhere as a direct
Andrew Svetlov added the comment:
Ages ago, get_event_loop() did not return the current running loop if called
from async function context; it returned a loop instance registered with
previous set_event_loop(...) call instead.
Later we fixed get_event_loop() behavior in 3.5.4 IIRC and added
Andrew Svetlov added the comment:
New changeset f27bef30438d2f07f19de91e021f34b77ccc4b20 by Rob in branch 'main':
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857)
https://github.com/python/cpython/commit/f27bef30438d2f07f19de91e021f34
Andrew Svetlov added the comment:
New changeset 4203a5d1918ca874e305806b787e3c8c6fc35e3e by Miss Islington (bot)
in branch '3.9':
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857) (GH-29878)
https://github.com/python/cpython/commit/4203a5d1918ca874e305806b787e3c
Andrew Svetlov added the comment:
New changeset e99c5e039b380199843db4e06974883d9f3ddad0 by Miss Islington (bot)
in branch '3.10':
bpo-45896: Fix docs default asyncio event loop on Windows (GH-29857) (GH-29877)
https://github.com/python/cpython/commit/e99c5e039b380199843db4e0697488
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
The reproducer is absent, closing
--
nosy: +asvetlov
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
Good point.
Currently, asyncio lock objects don't provide a strong FIFO guarantee.
In a tight loop, a task can re-acquire the lock just after releasing even if
there are pending waiters that were scheduled earlier. It's true also for Lock,
C
Andrew Svetlov added the comment:
Or, maybe, there is a way to do everything without changing public API.
The idea is: _wake_up_next can create a future which is set by *waked up task*
on its acquiring. acquire method should wait for this future first before
entering in `while self._value
Andrew Svetlov added the comment:
New changeset 265918bb1d782ab85c7dbc835eb62d6cfc2145b7 by Kumar Aditya in
branch 'main':
bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense
(GH-29894)
https://github.com/python/cpyt
Change by Andrew Svetlov :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Andrew Svetlov added the comment:
Agree, thanks!
--
status: pending -> open
___
Python tracker
<https://bugs.python.org/issue41174>
___
___
Python-bugs-lis
Andrew Svetlov added the comment:
The main branch has a dozen PyImport_ImportModuleNoBlock() usages.
Would you replace them also?
--
nosy: +asvetlov
versions: +Python 3.11 -Python 3.10
___
Python tracker
<https://bugs.python.org/issue45
Change by Andrew Svetlov :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Andrew Svetlov :
--
pull_requests: +28213
pull_request: https://github.com/python/cpython/pull/29990
___
Python tracker
<https://bugs.python.org/issue45
Andrew Svetlov added the comment:
Pablo, I think https://github.com/python/cpython/pull/29990 should be merged as
well before the issue closing.
It covers another execution branch.
--
resolution: fixed ->
status: closed -> open
___
Change by Andrew Svetlov :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue45813>
___
___
Python-bugs-list
Andrew Svetlov added the comment:
New changeset 3cb9731b7e59b0df9a7a9ab6b7746a669958b693 by Jacob Hayes in branch
'main':
bpo-45359: Support TopologicalSorter type subscript (GH-28714)
https://github.com/python/cpython/commit/3cb9731b7e59b0df9a7a9ab6b7746a669958b693
-
Andrew Svetlov added the comment:
The new feature is applied to Python 3.11 only
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: -Python 3.10, Python 3.9
___
Python tracker
<https://bug
Andrew Svetlov added the comment:
`if TYPE_CHECKING:` is a good choice, it works fine just now.
`from __future__ import annotations` is another alternative.
I don't see a reason for REMOVING already existing and correct annotations from
typ
Andrew Svetlov added the comment:
Thanks for the report!
I would say that deriving from the future class without calling
super().__init__() is an error.
After fixing this the snippet raises expected "RuntimeError: yield was used
instead of yield from in task&q
Andrew Svetlov added the comment:
Looks like get_future_loop() function misses ENSURE_FUTURE_ALIVE macro call.
--
___
Python tracker
<https://bugs.python.org/issue38
Change by Andrew Svetlov :
--
keywords: +patch
pull_requests: +16654
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17144
___
Python tracker
<https://bugs.python.org/issu
501 - 600 of 2519 matches
Mail list logo