[issue26270] Support for read()/write()/select() on asyncio

2019-05-27 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35279] asyncio uses too many threads by default

2019-05-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: asyncio uses bare concurrent.futures.ThreadPoolExecutor. Tha question is: should asyncio reduce the number of threads in the pool or concurrent.futures should change the default value? -- ___ Python tracker

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

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

[issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does

2019-05-27 Thread Andrew Svetlov
Andrew Svetlov added the comment: All we need is `program = os.fspath(program)` in base_events.py subprocess_exec() method. Is anybody volunteered to make a patch (with test and docs update, sure)? -- ___ Python tracker <https://bugs.python.

[issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does

2019-05-27 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue35246> ___ ___ Python-bugs-list mailin

[issue35279] asyncio uses too many threads by default

2019-05-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: I'm ok with changing the default threads number limit. Not sure about numbers. If you want to limit to 16-20 that may be ok but `cpu_count + 4` doesn't work in this case. On cloud servers, I see 128 or even more cores very often. 160+4 is not tha

[issue36996] unittest.mock.patch decorator doesn't work with async functions

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

[issue36933] sys.set_coroutine_wrapper documented as to be removed in 3.8 (still there)

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

[issue35279] asyncio uses too many threads by default

2019-05-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: > how about min(32, cpu_count+4)? I think it produces reasonable good numbers for any CPU count. Do you have time for preparing a pull request? -- ___ Python tracker <https://bugs.python.org/issu

[issue29883] asyncio: Windows Proactor Event Loop UDP Support

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

[issue29883] asyncio: Windows Proactor Event Loop UDP Support

2019-05-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: You are welcome, Victor! Thank you very much, Adam! -- ___ Python tracker <https://bugs.python.org/issue29883> ___ ___ Pytho

[issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does

2019-05-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Aha, I see. You are right. Let's drop checks for cmd/program/args types but left to subprocess do these checks. This approach avoiding complex checking/converting logic in asyncio itself and reduces code duplic

[issue36686] Docs: asyncio.loop.subprocess_exec documentation is confusing, it's not clear how to inherit stdin, stdout or stderr in the subprocess

2019-05-28 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed versions: -Python 3.5, Python 3.6, Python 3.7, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2019-05-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: >From my understanding, the correct code should close all transports and wait >for their connection_lost() callbacks before closing the loop. -- ___ Python tracker <https://bugs.python.org/i

[issue35621] asyncio.create_subprocess_exec() only works with main event loop

2019-05-28 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +13530 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13630 ___ Python tracker <https://bugs.python.org/issu

[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-05-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: *Passing* loop to gather should be deprecated. *Using* loop by *internal logic* is pretty fine, we do it in asyncio everywhere. Yuri, I think we should deprecate explicit loop everywhere in non-deprecated asyncio API by Python 3.8. We can do it even in

[issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does

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

[issue34793] Remove support for "with (await asyncio.lock):"

2019-05-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Let's postpone to 3.9 I recall at least reports for aioredis, aiomysql and aiokafka for these deprecation warnings. Sure, fix is trivial (and will be applied to next release of libs) but I pretty sure there are many other usages. -- ver

[issue32972] unittest.TestCase coroutine support

2019-05-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Done. Let's keep the issue open until the documentation will be committed -- ___ Python tracker <https://bugs.python.org/is

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

2019-05-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks for letting me know. Investigating. BrokenPipeError is not related, I had a plan to fix such messages during the beta phase. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-05-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: A champion is welcome :) -- ___ Python tracker <https://bugs.python.org/issue36373> ___ ___ Python-bugs-list mailing list Unsub

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2019-05-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: I would say that if requests a designed from scratch more idiomatic way could be with requests.Session() as session: session.get('https://example.com/') or session = requests.Session() session.get('https://example.com/') sessi

[issue33918] Hooking into pause/resume of iterators/coroutines

2019-05-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: decimal was changed from threading.local to contextvar usage. The module is "safe" not only for asyncio but for threading, trio etc. unittest.mock doesn't use explicit context all for patching. It changes global interpreter-wide objec

[issue33918] Hooking into pause/resume of iterators/coroutines

2019-05-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue33918> ___ ___

[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-05-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thank you. The change is pretty straightforward. There is no need to jumbo PR, you can split the work into PR-per-module if it is more comfortable to you. I'm ok with reviewing any approach. -- ___ P

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

2019-05-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue36373> ___ ___ Python-bugs-list mailin

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

2019-05-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- title: asyncio.gather: no docs for deprecated loop parameter -> Deprecate explicit loop parameter in all public asyncio APIs ___ Python tracker <https://bugs.python.org/issu

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

2019-05-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- title: asyncio.gather: no docs for deprecated loop parameter -> Deprecate explicit loop parameter in all public asyncio APIs ___ Python tracker <https://bugs.python.org/issu

[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

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

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

2019-05-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Wow! Thanks for the report. Internally it is pretty close to freebsd problem. The test is unstable, not asyncio code itself. The test uses future objects to synchronize client and server socket processing but looks like there are race conditions still

[issue37015] Fix asyncio mock warnings

2019-05-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2019-05-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: The difference is that socket.close() is an instant call. After socket.close() the socket is done. But transport.close() doesn't close the transport instantly. asyncio requires at least one loop iteration for calling protocol.connection_lost() and a

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2019-05-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: It's not about streams only. The stream protocol can have such flag, sure. But transport emits a warning like "unclosed transport ..." Not sure if we have to drop this warning, it enforces writing good code that controls all created reso

[issue36999] Expose the coroutine object in asyncio task objects

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

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2019-05-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry, I'm not comfortable with such change just before the feature freeze. The idea is maybe good but let's discuss and implement it later. -- ___ Python tracker <https://bugs.python.o

[issue35545] asyncio.base_events.create_connection doesn't handle scoped IPv6 addresses

2019-05-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Guys, thank you for investigation. If there is AIX "idiosyncrasy" -- please feel free to skip failed tests on AIX. If you have access to AIX box it would be much easier for you. I can only look at Python buildbo

[issue37105] Add deprecated-remove information on stream doc

2019-05-31 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset ed9f3562b637a59b9000abbceee5ae369d35444d by Andrew Svetlov (Emmanuel Arias) in branch 'master': bpo-37105: Add deprecated-remove information on stream doc (#13672) https://github.com/python/cpyt

[issue36813] QueueListener not calling task_done upon termination

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

[issue35621] asyncio.create_subprocess_exec() only works with main event loop

2019-06-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 13ed07998ad93dbdd94991ba0451b9b559f07972 by Andrew Svetlov in branch 'master': bpo-35621: Support running subprocesses in asyncio when loop is executed in non-main thread (#13630) https://github.com/python/cpyt

[issue35621] asyncio.create_subprocess_exec() only works with main event loop

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

[issue35635] asyncio.create_subprocess_exec() only works in main thread

2019-06-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed by #35621 -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio.create_subprocess_exec() only works with main event loop ___ Python tracker <https://

[issue32052] Provide access to buffer of asyncio.StreamReader

2019-06-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: Closing. Brief: 1. Access to an internal buffer is not an option. 2. Pushing data back to stream after fetching is not an option too: it kills almost any possible optimization and makes code overcomplicated. aiohttp used to have "unread_data()"

[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-06-02 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +13625 pull_request: https://github.com/python/cpython/pull/13630 ___ Python tracker <https://bugs.python.org/issue33

[issue31087] asyncio.create_subprocess_* should honor `encoding`

2019-06-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: encoding was explicitly disabled by #36686 Now its usage generates ValueError. asyncio stdio/stdout/stderr streams are bytes. If you want to propose a patch that supports text streams -- please create another issue for that. -- nosy: +asvetlov

[issue32115] Ignored SIGCHLD causes asyncio.Process.wait to hang forever

2019-06-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: #35621 fixes the problem for default ThreadedChildWatcher -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio.create_subprocess_exec() only works with mai

[issue35621] asyncio.create_subprocess_exec() only works with main event loop

2019-06-02 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +13635 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/13754 ___ Python tracker <https://bugs.python.org/issu

[issue35621] asyncio.create_subprocess_exec() only works with main event loop

2019-06-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks for the report! The failure depends on tests order execution (maybe you use -jN flag?). Before default child watcher was SafeChildWatcher, not it is ThreaderChildWather. The watcher is a global variable (a property of global event loop policy). The

[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-06-02 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +13642 pull_request: https://github.com/python/cpython/pull/13754 ___ Python tracker <https://bugs.python.org/issue33

[issue37141] Allow multiple separators in StreamReader.readuntil

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: Would you make a PR? I guess to modify Stream.readuntil() StreamReader is deprecated, I'm not sure if we should add new functionality to this class. -- ___ Python tracker <https://bugs.python.org/is

[issue34467] No mechanism to abort created coroutine or suppress not-awaited warning

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: Could you consider passing (async_func, args, kwargs) tuple instead async_func(*args, **kwargs) coroutine? Looks like it solves your problem and doesn't require asyncio changes -- ___ Python tracker &

[issue37141] Allow multiple separators in StreamReader.readuntil

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: Docs will be updated soon. The change has landed a week ago, I had no time for docs update before 3.8 beta. Sorry for that. The idea is: StreamReader and StreamWriter are merged into just Stream, open_connection() is replaced with connect() etc

[issue37141] Allow multiple separators in StreamReader.readuntil

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: Yes, Stream supports all StreamReader and StreamWriter methods -- ___ Python tracker <https://bugs.python.org/issue37

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

2019-06-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +13674 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/13790 ___ Python tracker <https://bugs.python.org/issu

[issue37137] test_asyncio: test_cancel_gather_2() dangling thread

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: I suspect that I've added this dangling thread by https://github.com/python/cpython/blob/master/Lib/asyncio/unix_events.py#L1248-L1251 :( -- nosy: +asvetlov ___ Python tracker <https://bugs.python.org/is

[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-06-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- nosy: -asvetlov ___ Python tracker <https://bugs.python.org/issue33694> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37137] test_asyncio: test_cancel_gather_2() dangling thread

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: Working on PR -- ___ Python tracker <https://bugs.python.org/issue37137> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37137] test_asyncio: test_cancel_gather_2() dangling thread

2019-06-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +13677 pull_request: https://github.com/python/cpython/pull/13792 ___ Python tracker <https://bugs.python.org/issue37

[issue37137] test_asyncio: test_cancel_gather_2() dangling thread

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: We have two options: 1. Apply https://github.com/python/cpython/pull/13792 to wait for dangling threads 2. Revert added watchers entirely What do you prefer? -- ___ Python tracker <https://bugs.python.

[issue35621] asyncio.create_subprocess_exec() only works with main event loop

2019-06-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +13678 pull_request: https://github.com/python/cpython/pull/13793 ___ Python tracker <https://bugs.python.org/issue35

[issue37137] test_asyncio: test_cancel_gather_2() dangling thread

2019-06-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: Got you. https://github.com/python/cpython/pull/13793 -- ___ Python tracker <https://bugs.python.org/issue37137> ___ ___ Pytho

[issue37148] test_asyncio fails on refleaks buildbots

2019-06-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: I'm curious if collections.__getattr__ suffers from the same problem? asyncio uses basically the same technique for deprecating global names on import. -- ___ Python tracker <https://bugs.python.org/is

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

2019-06-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: I still think that this is a valuable change but we need to discuss public API. In fact, in my job we used to override default executor and wait for its shutdown with explicit waiting to make the system robust. The problem is that loop.close() can "

[issue37142] test_asyncio timed out on AMD64 FreeBSD CURRENT Shared 3.x

2019-06-04 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: fixed -> status: closed -> open ___ Python tracker <https://bugs.python.org/issue37142> ___ ___ Python-bugs-list

[issue37142] test_asyncio timed out on AMD64 FreeBSD CURRENT Shared 3.x

2019-06-04 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +13689 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/13804 ___ Python tracker <https://bugs.python.org/issu

[issue37142] test_asyncio timed out on AMD64 FreeBSD CURRENT Shared 3.x

2019-06-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: Follow-up for https://github.com/python/cpython/pull/13790 is ready -- ___ Python tracker <https://bugs.python.org/issue37

[issue37142] test_asyncio timed out on AMD64 FreeBSD CURRENT Shared 3.x

2019-06-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: I mean https://github.com/python/cpython/pull/13804 -- ___ Python tracker <https://bugs.python.org/issue37142> ___ ___ Pytho

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

2019-06-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: Please keep it until new streams will be documented. -- ___ Python tracker <https://bugs.python.org/issue36889> ___ ___ Pytho

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

2019-06-05 Thread Andrew Svetlov
Andrew Svetlov added the comment: I prefer postponing to think about it until all required 3.8 tasks are done :) -- ___ Python tracker <https://bugs.python.org/issue34

[issue34767] Optimize asyncio.Lock

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

[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Andrew Svetlov
Andrew Svetlov added the comment: I believe the number still can be configurable but requires more work. The idea is: FD_* macroses should be replaced with custom fd_set manipulation functions. on select.select() call we can calculate the number of the highest used socket and use this number

[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Andrew Svetlov
Andrew Svetlov added the comment: >From my understanding Steve is right. -- ___ Python tracker <https://bugs.python.org/issue28708> ___ ___ Python-bugs-lis

[issue35082] Mock.__dir__ lists deleted attributes

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

[issue35082] Mock.__dir__ lists deleted attributes

2019-06-06 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue35082> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37172] Odd error awating a Future

2019-06-06 Thread Andrew Svetlov
Andrew Svetlov added the comment: Global future objects (and global asyncio objects in general) don't work with asyncio.run(). The lifecycle of these objects should be closer than loop but asyncio.run() creates a loop during execution. I think this is a good design, we have a pl

[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-07 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.7 ___ Python tracker <https://bugs.python.or

[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/issue37173> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: I think landing the fix to 3.8 only is just fine -- nosy: +asvetlov ___ Python tracker <https://bugs.python.org/issue37

[issue37173] inspect.getfile error names module instead of passed class

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

[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: This is the expected behavior. asyncio.ensure_future() returns not a future but a task for your case. Task cancellation requires at least one context switch to finish the task. P.S. I suggest replacing `asyncio.ensure_future()` with `asyncio.create_task

[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Andrew Svetlov
Andrew Svetlov added the comment: I don't follow what reliability guarantee are you requesting. A cite from task.cancel() docstring: > Request that this task cancel itself. This arranges for a CancelledError to be thrown into the wrapped coroutine on the next cycle

[issue37172] Odd error awaiting a Future

2019-06-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: Not sure what "idempotency fix" means in the context of Future objects. Could you describe desired behavior or, even better, provide a pull request that demonstrates your desire? -- ___ Python track

[issue29717] `loop.add_reader` and `<

2019-06-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: If fd is a regular file it is not supported well by all select/poll/epoll. Registration may succeed but the data is marked as "already ready for reading". Not sure if we should do anything. The situation may be changed after eventual providing async

[issue37172] Odd error awaiting a Future

2019-06-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree, it would be fine. So the behavior is not changed but the error text should be clear, right? -- ___ Python tracker <https://bugs.python.org/issue37

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-06-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: There is no chance to change the flag for 3.7. But we can consider it for 3.8 Yuri, what do you think? -- ___ Python tracker <https://bugs.python.org/issue37

[issue37226] Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range

2019-06-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: Just to clarify: what OpenSSL version is used? -- ___ Python tracker <https://bugs.python.org/issue37226> ___ ___ Python-bug

[issue37226] Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range

2019-06-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: That's what I afraid. asyncio/sslproto.py fails on new OpenSSL at several places :( -- ___ Python tracker <https://bugs.python.org/is

[issue34467] No mechanism to abort created coroutine or suppress not-awaited warning

2019-06-11 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34467> ___ ___

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

2019-06-11 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +13838 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13971 ___ Python tracker <https://bugs.python.org/issu

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

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

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

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

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

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

[issue37226] Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range

2019-06-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thank you! Yuri, you might be interested too -- ___ Python tracker <https://bugs.python.org/issue37226> ___ ___ Python-bug

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

2019-06-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Lukasz, please don't rush. Applied PR makes asyncio more stable, not worse. I see the only way to make it perfect: get rid of weak refs entirely. Otherwise there is always a chance to catch GC run and set element deletion on iteration over the set.

[issue37263] spawn asyncio subprocesses in a thread pool

2019-06-13 Thread Andrew Svetlov
New submission from Andrew Svetlov : Subprocess starting can be a long blocking operation, see https://github.com/python-trio/trio/issues/1109 for discussion -- messages: 345472 nosy: asvetlov priority: normal severity: normal status: open title: spawn asyncio subprocesses in a thread

[issue37077] Threading: add builtin TID attribute to Thread objects for AIX

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

[issue37279] asyncio sendfile sends extra data in the last chunk in fallback mode

2019-06-14 Thread Andrew Svetlov
New submission from Andrew Svetlov : My fault introduced in 3.7 in initial async sendfile implementation -- components: asyncio messages: 345571 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio sendfile sends extra data in the last chunk in

[issue37279] asyncio sendfile sends extra data in the last chunk in fallback mode

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

[issue37280] Use threadpool for reading from file for sendfile fallback mode

2019-06-14 Thread Andrew Svetlov
New submission from Andrew Svetlov : We use thread pool executor for loop.sock_sendfile(), there is no reason to call blocking code for loop.sendfile() -- components: asyncio messages: 345574 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Use

[issue37280] Use threadpool for reading from file for sendfile fallback mode

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

[issue37281] asyncio Task._fut_waiter done callback

2019-06-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: 1. Task._fut_waiter is a private API, please avoid it 2. Task class is derived from Future, thus it HAS add_done_callback() method. The other question is that from my experience if the application-level code uses add_done_callback() the design is not perfect

<    9   10   11   12   13   14   15   16   17   18   >