[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2019-09-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Let's keep it open if you don't give up the issue entirely. -- ___ Python tracker <https://bugs.python.org/issue30491> ___ __

[issue27589] asyncio doc: issue in as_completed() doc

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue27589> ___ ___

[issue32395] asyncio.StreamReader.readuntil is not general enough

2019-09-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Allow multiple separators in Stream.readuntil ___ Python tracker <https://bugs.python

[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +15655 pull_request: https://github.com/python/cpython/pull/16033 ___ Python tracker <https://bugs.python.org/issue36

[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-09-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset a488879cbaf4b8b52699cadccf73bb4c271bcb29 by Andrew Svetlov in branch 'master': bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033) https://github.com/python/cpython/commit/a488879cbaf4b8b52699cadccf73bb

[issue35620] asyncio test failure on appveyor

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37141] Allow multiple separators in Stream.readuntil

2019-09-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: please do -- ___ Python tracker <https://bugs.python.org/issue37141> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38013] AsyncGenerator breaks when not iterated fully with RuntimeError("can't send non-None value to a just-started coroutine")

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +15684 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16061 ___ Python tracker <https://bugs.python.org/issu

[issue38013] AsyncGenerator breaks when not iterated fully with RuntimeError("can't send non-None value to a just-started coroutine")

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +15691 pull_request: https://github.com/python/cpython/pull/16070 ___ Python tracker <https://bugs.python.org/issue38

[issue37455] asyncio.run() error related to finalizing async generators

2019-09-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Yes, please close as a duplicate. -- ___ Python tracker <https://bugs.python.org/issue37455> ___ ___ Python-bugs-list mailin

[issue38107] Replace direct future and task contructor calls with factories in asyncio tests

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38148] Add slots to asyncio transports

2019-09-12 Thread Andrew Svetlov
New submission from Andrew Svetlov : Transports are abstract interfaces. Adding slots allows using slots in transport implementations as well. If the implementation doesn't use slots -- everything keeps working. Slots can help with saving a memory footprint a little. -- compo

[issue38148] Add slots to asyncio transports

2019-09-12 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +15699 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16077 ___ Python tracker <https://bugs.python.org/issu

[issue38148] Add slots to asyncio transports

2019-09-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Note, slots for protocols are provided by 3.8 already. -- ___ Python tracker <https://bugs.python.org/issue38148> ___ ___ Pytho

[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-09-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38104] File descriptor error when subprocess call is used with event loop enabled in main thread

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: You spawn too many subprocesses that finish virtually at the same time. It leads to wakeup_fd overrun. Python 3.6 is in security mode, sorry (and the fix is impossible). Python 3.7 has warn_on_full_buffer=False flag for https://docs.python.org/3/library

[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-09-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.9 -Python 2.7 ___ Python tracker <https://bugs.python.org/issue12144> ___ ___ Python-bugs-list mailin

[issue23837] asyncio: read pipe transport tries to resume reading after loop is gone

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: The issue can be closed, loop.add_reader() / loop.remove_reader() calls correctly handle closed loop now -- nosy: +asvetlov resolution: -> out of date stage: -> resolved status: open -> closed ___ Pytho

[issue38148] Add slots to asyncio transports

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 9eb35ab0d71a6bd680e84fa0f828cb634e72b681 by Andrew Svetlov in branch 'master': bpo-38148: Add slots to asyncio transports (GH-16077) https://github.com/python/cpython/commit/9eb35ab0d71a6bd680e84fa0f828cb

[issue38148] Add slots to asyncio transports

2019-09-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +15714 pull_request: https://github.com/python/cpython/pull/16093 ___ Python tracker <https://bugs.python.org/issue38

[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset e7b7edf5ebaed14dc68c841a8a98260f1330ef9a by Andrew Svetlov (Xtreak) in branch '3.7': [3.7] bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921) (GH-16092) https://github.com/python/cpyt

[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-09-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37404] asyncio sock_recv blocks on ssl sockets.

2019-09-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +easy, newcomer friendly ___ Python tracker <https://bugs.python.org/issue37404> ___ ___ Python-bugs-list mailin

[issue38148] Add slots to asyncio transports

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 6638c9226066205a646e18da95b33e619d784b0b by Andrew Svetlov in branch '3.8': [3.8] bpo-38148: Add slots to asyncio transports (GH-16077) (GH-16093) https://github.com/python/cpython/commit/6638c9226066205a646e18da95b33e

[issue38148] Add slots to asyncio transports

2019-09-13 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34344] Fix the docstring for AbstractEventLoopPolicy.get_event_loop

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: Vlad, the PR is very welcome! -- ___ Python tracker <https://bugs.python.org/issue34344> ___ ___ Python-bugs-list mailin

[issue26140] inspect.iscoroutinefunction raises TypeError when checks Mock of function or coroutinefunction

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: I believe after implementing AsyncMock we can close the issue -- nosy: +asvetlov resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue26140] inspect.iscoroutinefunction raises TypeError when checks Mock of function or coroutinefunction

2019-09-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: I believe with AsyncMock implemented we can close the issue -- ___ Python tracker <https://bugs.python.org/issue26140> ___ ___

[issue38164] polishing asyncio Streams API

2019-09-14 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +15758 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/16148 ___ Python tracker <https://bugs.python.org/issu

[issue38166] ast identifies incorrect column for compound attribute lookups

2019-09-15 Thread Andrew Briand
Andrew Briand added the comment: It looks like the test suite (in particular test_ast) specifically checks for the behavior where the col_offset of c in a.b.c.d is 0. This seems strange to me though, does anyone know if this is intended? If not, I can patch it. -- nosy

[issue38013] AsyncGenerator breaks when not iterated fully with RuntimeError("can't send non-None value to a just-started coroutine")

2019-09-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: I have a PR for the fix. Yuri preliminary agrees with the patch but he requested more time for careful review. I've added 'release blocker' priority to don't miss this bugfix for the next release. -- nosy: +lukasz.langa, ned.de

[issue38178] Remove explicit "loop" argument from EchoClientProtocol example

2019-09-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks Hrvoje! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38019] asyncio subprocess AttributeError: 'NoneType' object has no attribute '_add_reader' / '_remove_reader'

2019-09-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks. The correct fix is 'do nothing if stream._transport is None'. We have only two weeks before 3.8rc, thus I'll prepare a fix myself for the sake of fast merging. -- assignee: -> asvetlov

[issue38019] asyncio subprocess AttributeError: 'NoneType' object has no attribute '_add_reader' / '_remove_reader'

2019-09-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: This fix cannot land on 3.6, the version is in security-fix only mode. -- versions: -Python 3.6 ___ Python tracker <https://bugs.python.org/issue38

[issue38178] Remove explicit "loop" argument from EchoClientProtocol example

2019-09-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: Raymond, sorry if I was so quick in applying. The patch is very trivial and obvious. I am pretty sure that Yuri and Victor approve it. The PR doesn't fix a mistake, the code is still valid. But we all changed our mind what is the loop role, should

[issue38013] AsyncGenerator breaks when not iterated fully with RuntimeError("can't send non-None value to a just-started coroutine")

2019-09-16 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks, Ned. I love to include this in 3.7.5. I've pinged Yuri offline with ask for review -- ___ Python tracker <https://bugs.python.org/is

[issue38192] Fix invocation of EchoClientProtocol

2019-09-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38013] AsyncGenerator breaks when not iterated fully with RuntimeError("can't send non-None value to a just-started coroutine")

2019-09-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2019-09-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thnks, Kyle! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2019-09-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 9fdc64cf1266b6d5bf0503847b5c38e5edc53a14 by Andrew Svetlov (Kyle Stanley) in branch 'master': bpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() (GH-15735) https://github.com/python/cpyt

[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2019-09-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: I think we need better name than just `_is_coroutine`. All async function properties as dunder named, the new *official* name should follow this convention as well -- ___ Python tracker <https://bugs.python.

[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2019-09-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: I think `func.__awaitable__ = True` can serve all possible situations. We need it for async mocks (now the library use flawless `_is_coroutine` approach. `__awaitable__` can also cover cases where a regular function returns awaitable object or there is a

[issue38242] Revert the new asyncio Streams API

2019-09-21 Thread Andrew Svetlov
Andrew Svetlov added the comment: There is an alternative proposal: let's deprecate and eventually remove streams API entirely (for sockets, pipes, and subprocesses). By this, we will never have a chance to conflict with trio. Another option is removing asyncio at all (again to

[issue38242] Revert the new asyncio Streams API

2019-09-21 Thread Andrew Svetlov
Change by Andrew Svetlov : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue38242> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38242] Revert the new asyncio Streams API

2019-09-21 Thread Andrew Svetlov
Andrew Svetlov added the comment: I would say that we can reimplement the Stream class on top of new composable streams in the future. I'd love to do it right now but these streams don't exist yet. I totally support the idea of new streams design, it looks very attra

[issue38242] Revert the new asyncio Streams API

2019-09-21 Thread Andrew Svetlov
Change by Andrew Svetlov : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue38242> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38242] Revert the new asyncio Streams API

2019-09-21 Thread Andrew Svetlov
Andrew Svetlov added the comment: Awesome! -- ___ Python tracker <https://bugs.python.org/issue38242> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38260] asyncio.run documentation does not mention its return value

2019-09-25 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-09-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: I think if we want to support SOCK_SEQPACKET by asyncio we should do it explicitly. In the other case, we can open a can of worms: we cannot guarantee that all existing protocols are supported by asyncio seamlessly. Anyway, this is a new feature request

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-09-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: We can implement these using the following procedure: 1. Use only one socket type per pull request 2. Add support for, e.g. SOCK_SEQPACKET to asyncio code 3. Add test(s) that checks that SOCK_SEQPACKET works fine (./Lib/test/test_asyncio folder, perhaps

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-09-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: If you have no time for contribution -- that's fine, CPython is the Open Source project driven by volunteers. The only caveat is that the issue may wait for years before we find a champion to pick it up. For example, this particular problem is on the

[issue38306] High level API for loop.run_in_executor(None, ...)?

2019-09-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: I'd like to see how thread pools integrate with (not existing yet bug planned for 3.9) task groups before pushing forward the proposed approach. -- ___ Python tracker <https://bugs.python.org/is

[issue38019] asyncio subprocess AttributeError: 'NoneType' object has no attribute '_add_reader' / '_remove_reader'

2019-09-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +16056 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16472 ___ Python tracker <https://bugs.python.org/issu

[issue38314] Implement unix read_pipe.is_reading() method

2019-09-29 Thread Andrew Svetlov
New submission from Andrew Svetlov : Sockets support it, there is no reason for missing the method in unix pipe. -- components: asyncio messages: 353494 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Implement unix read_pipe.is_reading() method

[issue38314] Implement unix read_pipe.is_reading() method

2019-09-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: The issue is easy, basically we need the following code plus a test def is_reading(self): return not self._paused and not self._closing -- keywords: +newcomer friendly type: -> enhancement ___ Pyt

[issue38019] asyncio subprocess AttributeError: 'NoneType' object has no attribute '_add_reader' / '_remove_reader'

2019-09-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 58498bc7178608b1ab031994ca09c43889ce3e76 by Andrew Svetlov in branch 'master': bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe (GH-16472) https://github.com/python/cpyt

[issue38314] Implement unix read_pipe.is_reading() method

2019-09-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Nothing special. There is UnixReadPipeTransportTests test cases inside Lib/test/test_asyncio/test_unix_events.py This class has a bunch of tests for pause_reading() / resume_reading(). Test(s) for is_reading() can be built in the same way

[issue38019] asyncio subprocess AttributeError: 'NoneType' object has no attribute '_add_reader' / '_remove_reader'

2019-09-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38359] pyw.exe opens console window in Windows 10

2019-10-03 Thread Andrew Ushakov
New submission from Andrew Ushakov : pyw.exe (Python Launcher for Windows Version 3.8.121.1013) opens a console window at startup. To reproduce, run command below from the console: D:>pyw -c "import time; time.sleep(10)" By the way command: D:>pythomw -c "import time; t

[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: You MUST await a future returned from `loop.run_in_executor()` to avoid the leak. Yuri, what should we do with the issue? I see the second similar report in the last half of the year. Sure, we can add weakrefs somewhere in futures._chain_future() but I

[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: Victor answered the first :) -- ___ Python tracker <https://bugs.python.org/issue38430> ___ ___ Python-bugs-list mailin

[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: > Can a Task be used instead of a Future in run_in_executor()? I don't think that the task is required here. The problem is that run_in_executor is a function that returns asyncio future; that is in turn a wrapper around concurrent future object

[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: The change is slightly not backward compatible but 1. It's pretty visible. In the worst-case instead of the memory leak people see a RuntimeWarning 2. We did it already for a part of API, e.g. loop.sock_read() and f

[issue38460] 3.8 Release Notes: document asyncio exception changes

2019-10-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: > code that incorrectly imported directly from the submodules will break That's true. Please note: incorrect code will break. The correct code keeps working. I'm personally not sure if we need to reflect *private* API change in Release No

[issue38563] Asyncio regression on Windows with Python 3.8

2019-10-23 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue38563> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38563] Asyncio regression on Windows with Python 3.8

2019-10-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: Pull Request is welcome! -- ___ Python tracker <https://bugs.python.org/issue38563> ___ ___ Python-bugs-list mailing list Unsub

[issue38591] Deprecate Process Child Watchers

2019-10-25 Thread Andrew Svetlov
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

[issue38591] Deprecate Process Child Watchers

2019-10-26 Thread Andrew Svetlov
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

[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2019-10-27 Thread Andrew Svetlov
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

[issue38599] Deprecate creation of asyncio object when the loop is not running

2019-10-27 Thread Andrew Svetlov
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

[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2019-10-27 Thread Andrew Svetlov
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.

[issue38314] Implement unix read_pipe.is_reading() method

2019-10-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: Please do. -- ___ Python tracker <https://bugs.python.org/issue38314> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2019-10-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: lgtm -- ___ Python tracker <https://bugs.python.org/issue34790> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38599] Deprecate creation of asyncio object when the loop is not running

2019-10-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: At least it is my learned lesson from aiohttp development. -- ___ Python tracker <https://bugs.python.org/issue38599> ___ ___

[issue38599] Deprecate creation of asyncio object when the loop is not running

2019-10-27 Thread Andrew Svetlov
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

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-10-28 Thread Andrew Svetlov
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

[issue34975] start_tls() difficult when using asyncio.start_server()

2019-10-28 Thread Andrew Svetlov
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

[issue38599] Deprecate creation of asyncio object when the loop is not running

2019-10-28 Thread Andrew Svetlov
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-

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-10-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- components: +asyncio nosy: +yselivanov ___ Python tracker <https://bugs.python.org/issue38608> ___ ___ Python-bugs-list mailin

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-10-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Well, if the reported line is invalid it should be fixed -- ___ Python tracker <https://bugs.python.org/issue38608> ___ ___

[issue32309] Implement asyncio.run_in_executor shortcut

2019-11-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: `run` should be awaitable method, see #38430 -- ___ Python tracker <https://bugs.python.org/issue32309> ___ ___ Python-bug

[issue32309] Implement asyncio.run_in_executor shortcut

2019-11-01 Thread Andrew Svetlov
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 &

[issue38664] await execution order leads to throw or bad syntax

2019-11-01 Thread Andrew Svetlov
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

[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-11-01 Thread Andrew Svetlov
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_

[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-11-02 Thread Andrew Svetlov
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

[issue37373] Configuration of windows event loop for libraries

2019-11-03 Thread Andrew Svetlov
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

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov
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()

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov
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

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: Another question: does SSL/TLS make sense for seqpacket? -- ___ Python tracker <https://bugs.python.org/issue38285> ___ ___

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-04 Thread Andrew Svetlov
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

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov
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

[issue38692] add a pidfd child process watcher

2019-11-05 Thread Andrew Svetlov
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

[issue38692] add a pidfd child process watcher

2019-11-05 Thread Andrew Svetlov
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

[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-05 Thread Andrew Svetlov
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

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-05 Thread Andrew Svetlov
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

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-05 Thread Andrew Svetlov
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

[issue38737] StreamReaderProtocol.eof_received() should return True only for _SSLProtocolTransport

2019-11-07 Thread Andrew Svetlov
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

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-07 Thread Andrew Svetlov
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

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-20 Thread Andrew Dailey
New submission from Andrew Dailey : Hello, I think I might've stumbled onto an oversight with how an SSLSocket handles overwriting its SSLContext within an sni_callback. If both "_msg_callback" and "sni_callback" are defined on an SSLContext object and the sni_callb

<    2   3   4   5   6   7   8   9   10   11   >