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

2021-03-21 Thread Andrew Dailey
Andrew Dailey added the comment: I'm glad that the info I provided was helpful! I'll go ahead and create another issue for the misleading docs surrounding SSLContext.sni_callback. Thanks for looking into this and coming up with a fix so quickly. I do have one more question: d

[issue43582] SSLContext.sni_callback docs inaccurately describe available handshake info

2021-03-21 Thread Andrew Dailey
New submission from Andrew Dailey : Hello, The documentation for SSLContext.sni_callback [0] seems to incorrectly describe the information available at that stage of the TLS handshake. According to the docs: Due to the early negotiation phase of the TLS connection, only limited methods and

[issue43582] SSLContext.sni_callback docs inaccurately describe available handshake info

2021-03-21 Thread Andrew Dailey
Change by Andrew Dailey : -- nosy: +christian.heimes ___ Python tracker <https://bugs.python.org/issue43582> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43582] SSLContext.sni_callback docs inaccurately describe available handshake info

2021-03-21 Thread Andrew Dailey
Andrew Dailey added the comment: Yea, I'm still on the hunt for a better way to solve my primary problem: detect an acme-tls/1 ALPN protocol request during the TLS handshake so that I can swap out the context to one with the cert chain that Let's Encrypt is expecting to see. It

[issue43582] SSLContext.sni_callback docs inaccurately describe available handshake info

2021-03-21 Thread Andrew Dailey
Andrew Dailey added the comment: Yea, I noticed that through some of my digging. The ALPN callback is used to implement SSLContext.set_alpn_protocols() but full control of the callback isn't exposed. Aside from adjusting how the ALPN callback used, do you know of any other way to

[issue43582] SSLContext.sni_callback docs inaccurately describe available handshake info

2021-03-25 Thread Andrew Dailey
Andrew Dailey added the comment: Okay, that makes sense. I appreciate the overview! What do you feel is the best way to "solve" this issue, then? Should the docs be updated to reflect the fact that ALPN info isn't available in the sni_callback? Or should some code be modif

[issue43736] asyncio create_task() odd behavior

2021-04-06 Thread Andrew Svetlov
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

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2021-04-13 Thread Andrew Ushakov
Andrew Ushakov added the comment: Just tested again: D:\Downloads>py Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 4 2021, 13:27:16) [MSC v.1928 64 bit (AM

[issue37179] asyncio loop.start_tls() provide support for TLS in TLS

2021-04-13 Thread Andrew Svetlov
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

[issue40379] multiprocessing's default start method of fork()-without-exec() is broken

2021-04-29 Thread Andrew Duncan
Andrew Duncan added the comment: I just ran into and fixed (thanks to itamarst's blog post) a problem likely related to this. Multiprocessing workers performing work and sending a logging message back with success/fail info. I had a few intermittent deadlocks that became a recu

[issue44011] Borrow asyncio ssl implementation from uvloop

2021-05-02 Thread Andrew Svetlov
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

[issue44011] Borrow asyncio ssl implementation from uvloop

2021-05-02 Thread Andrew Svetlov
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

[issue44011] Borrow asyncio ssl implementation from uvloop

2021-05-02 Thread Andrew Svetlov
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

[issue44011] Borrow asyncio ssl implementation from uvloop

2021-05-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +24526 pull_request: https://github.com/python/cpython/pull/25842 ___ Python tracker <https://bugs.python.org/issue44

[issue44011] Borrow asyncio ssl implementation from uvloop

2021-05-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +24529 pull_request: https://github.com/python/cpython/pull/25846 ___ Python tracker <https://bugs.python.org/issue44

[issue41756] Do not always use exceptions to return result from coroutine

2021-05-05 Thread Andrew Svetlov
Change by Andrew Svetlov : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue41756> ___ ___ Pyth

[issue44432] SourceFileLoader.load_module() is mixing content of previosly loaded files

2021-06-15 Thread Andrew Johnson
New submission from Andrew Johnson : Hi, I'm loading multiple files in same convention - same filename, as a part of creating a build system. I can compare the case to the loading multple configuration files for various plugins in the application, the file contents of multiple files

[issue44475] Dataclass Causes Infinite Recursion when using type of bytes

2021-06-21 Thread Andrew C
New submission from Andrew C : Hello, When given a `Field` on a Dataclass, the `__repr__` throws an infinite recursive error when the data type is bytes. In the `Field` class, the __repr__ is as follows: ``` def __repr__(self): return ( 'Field('

[issue43832] asyncio + multiprocessing = core dump in sem_trywait

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

[issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface)

2021-07-13 Thread Andrew Svetlov
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

[issue39221] Cross compiled python installed wrong version of lib2to3/Grammar pickle

2021-07-16 Thread Andrew Aladjev
Andrew Aladjev added the comment: Hello. I've received more problems with pickle generation, reviewed source code, invented better bike for solving it. So I can provide full description of this issue and reduce other developers time on debugging. Problem: 1. Martin v. Löwis intro

[issue40327] list(sys.modules.items()) can throw RuntimeError: dictionary changed size during iteration

2021-08-25 Thread Andrew Nelson
Andrew Nelson added the comment: Just to mention that we have seen similar issues whilst importing scipy in a multiprocessing context. See https://github.com/scipy/scipy/issues/11479 and https://stackoverflow.com/questions/68911221/python-runtimeerror-dictionary-changed-size-during-iteration

[issue45106] Issue formating for log on Linux machines

2021-09-05 Thread Andrew Suttle
New submission from Andrew Suttle : Using the format option for Python logging works fine on all windows machines: logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.DEBUG,format='%(asctime)s : %(message)s ') But error occurs on Linux mint

[issue45194] asyncio scheduler jitter

2021-09-14 Thread Andrew Svetlov
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

[issue45262] crash if asyncio is used before and after re-initialization if using python embedded in an application

2021-09-22 Thread Andrew Svetlov
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

[issue1170] shlex have problems with parsing unicode

2021-09-29 Thread Andrew Jewett
Andrew Jewett added the comment: After posting that, I noticed that the second example I listed in my previous post (a language where words contain any non-whitespace, non-parenthesis character) can now be implemented in the current version of shlex.py by setting ​"whitespace_true

[issue1170] shlex have problems with parsing unicode

2021-09-29 Thread Andrew Jewett
Andrew Jewett added the comment: Alright. I'll think about it a little more and post my suggestion there, perhaps. Thanks Victor. -- ___ Python tracker <https://bugs.python.org/i

[issue45416] "loop argument must agree with lock" instantiating asyncio.Condition

2021-10-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks, guys! -- ___ Python tracker <https://bugs.python.org/issue45416> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45416] "loop argument must agree with lock" instantiating asyncio.Condition

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

[issue45671] str(CancelledError()) is empty

2021-10-29 Thread Andrew Svetlov
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

[issue45625] Add support for top-level await

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

[issue45690] Argparse exclusive group inside required exclusive group displays incorrectly

2021-11-02 Thread andrew cooke
New submission from andrew cooke : The code below, when invoked with -h, prints: (.env) [andrew@localhost py]$ python -m tests_sa.argparse_bug -h usage: argparse_bug.py [-h] (-a A | [-b B | -c C)] options: -h, --help show this help message and exit -a A -b B -c C where the final two

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

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

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

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

[issue40740] Missing api-ms-win-core-path-l1-1.0.dll for python-3.9.0b1-amd64.exe Under Win7

2021-11-04 Thread Andrew Ushakov
Andrew Ushakov added the comment: Is the missed api-ms-win-core-path-l1-1.0.dll library the only reason of the Python 3.9 and 3.10 incompatibility with Windows 7? I am asking because I just found replacement of this dll, compatible with Windows 7: https://github.com/nalexandru/api-ms-win

[issue28533] Remove asyncore, asynchat and smtpd modules

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

[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Andrew Svetlov
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

[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Andrew Svetlov
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

[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Andrew Svetlov
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

[issue45772] socket.socket should be a class instead of a function

2021-11-12 Thread Andrew Svetlov
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

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Andrew Svetlov
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

[issue45752] copy module doc wrongly says it doesn't copy arrays

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

[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

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

[issue28806] Improve the netrc library

2021-11-17 Thread Andrew Svetlov
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 -

[issue28806] Improve the netrc library

2021-11-17 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.11 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue28806> ___ ___ Python-bugs-list mailin

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-11-24 Thread Andrew Svetlov
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

[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread Andrew Svetlov
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

[issue45900] Type annotations needed for convenience functions in ipaddress module

2021-11-25 Thread Andrew Svetlov
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

[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread Andrew Svetlov
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

[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread Andrew Svetlov
Change by Andrew Svetlov : -- versions: +Python 3.11 ___ Python tracker <https://bugs.python.org/issue45568> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45568] @asynccontextmanager is missing in decorator usage example

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

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread Andrew Svetlov
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:

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread Andrew Svetlov
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

[issue19460] Add test for MIMENonMultipart

2021-11-28 Thread Andrew Svetlov
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

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-11-29 Thread Andrew Svetlov
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

[issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread

2021-11-29 Thread Andrew Svetlov
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

[issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread

2021-11-29 Thread Andrew Svetlov
Change by Andrew Svetlov : -- assignee: -> asvetlov ___ Python tracker <https://bugs.python.org/issue43498> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread

2021-11-29 Thread Andrew Svetlov
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

[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

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

[issue19460] Add test for MIMENonMultipart

2021-11-29 Thread Andrew Svetlov
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

[issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread

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

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-11-30 Thread Andrew Svetlov
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

[issue39529] Deprecate get_event_loop()

2021-12-01 Thread Andrew Svetlov
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

[issue39529] Deprecate get_event_loop()

2021-12-01 Thread Andrew Svetlov
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

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-12-01 Thread Andrew Svetlov
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

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-12-01 Thread Andrew Svetlov
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

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-12-01 Thread Andrew Svetlov
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

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

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

[issue45976] Random._randbelow() loses time by caching an attribute lookup

2021-12-03 Thread Andrew Lin
New submission from Andrew Lin : This PR obtains a performance improvement in the random module by removing a cached attribute lookup in Random._randbelow_with_getrandbits() that costs time on average. In the best cases (on my machine) I get 10% improvement for randrange(), 7% for shuffle

[issue45976] Random._randbelow() loses time by caching an attribute lookup

2021-12-03 Thread Andrew Lin
Andrew Lin added the comment: Timings are unaffected by updating to non-walrus, so I'll do so in the PR. Using _randbelow_without_getrandbits() I get 5% improvement to sample([None] * 2047, 50); 6% to shuffle([None] * 2000); and approximately 6% to randrange() for any number signific

[issue45976] Random._randbelow() loses time by caching an attribute lookup

2021-12-03 Thread Andrew Lin
Andrew Lin added the comment: I finally cleaned up my benchmark script, which feels like a big hack. I should really learn to use pyperf or something. Inspired by your comment about 3.8 on the Mac I tried my Ubuntu installation's stock 3.8. I get a small degradation (~0.5%) for powe

[issue45976] Random._randbelow() loses time by caching an attribute lookup

2021-12-03 Thread Andrew Lin
Change by Andrew Lin : Added file: https://bugs.python.org/file50473/randbelow_timing.py ___ Python tracker <https://bugs.python.org/issue45976> ___ ___ Python-bug

[issue45823] python stopped working

2021-12-04 Thread Andrew Svetlov
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

[issue45976] Random._randbelow() loses time by caching an attribute lookup

2021-12-04 Thread Andrew Lin
Andrew Lin added the comment: E[calls] reduces down to 2**k / n. I only just realized from working that out that it therefore doesn't quite vary linearly over [2**k, 2**(k+1)), although by what weight one wants to average I couldn't say. Personally if the change adverse

[issue45997] asyncio.Semaphore waiters deqeueu doesn't work

2021-12-06 Thread Andrew Svetlov
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

[issue45997] asyncio.Semaphore waiters deque doesn't work

2021-12-06 Thread Andrew Svetlov
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

[issue23819] test_asyncio fails when run under -O

2021-12-06 Thread Andrew Svetlov
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

[issue28953] Use `raise from` when raising new IncompleteRead

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

[issue41174] asyncio.coroutine decorator returns a non-generator function when using PYTHONASYNCIODEBUG

2021-12-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree, thanks! -- status: pending -> open ___ Python tracker <https://bugs.python.org/issue41174> ___ ___ Python-bugs-lis

[issue45855] PyCapsule_Import still using PyImport_ImportModuleNoBlock

2021-12-08 Thread Andrew Svetlov
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

[issue46012] unittest AsyncConnection not described

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

[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-12-08 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +28213 pull_request: https://github.com/python/cpython/pull/29990 ___ Python tracker <https://bugs.python.org/issue45

[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-12-08 Thread Andrew Svetlov
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 ___

[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-12-08 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed status: open -> closed ___ Python tracker <https://bugs.python.org/issue45813> ___ ___ Python-bugs-list

[issue45359] TopologicalSorter is not Generic at runtime (but is in typeshed)

2021-12-08 Thread Andrew Svetlov
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 -

[issue45359] TopologicalSorter is not Generic at runtime (but is in typeshed)

2021-12-09 Thread Andrew Svetlov
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

[issue45359] TopologicalSorter is not Generic at runtime (but is in typeshed)

2021-12-09 Thread Andrew Svetlov
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

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2019-11-09 Thread Andrew Ushakov
New submission from Andrew Ushakov : Not very long unicode comment #, space and then 170 or more repetitions of the utf8 symbol ░ (b'\xe2\x96\x91&#x

[issue38785] Segmentation fault in asyncio

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

[issue38785] Segmentation fault in asyncio

2019-11-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: Looks like get_future_loop() function misses ENSURE_FUTURE_ALIVE macro call. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38785] Segmentation fault in asyncio

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

[issue38785] Segmentation fault in asyncio

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

[issue38692] add a pidfd child process watcher

2019-11-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry for the late review. PidfdChildWatcher should be enumerated in unix_events.py:__all__ to make the class visible by asyncio import rules. Kyle, would you make a post-fix PR? -- resolution: fixed -> status: closed ->

[issue38591] Deprecate Process Child Watchers

2019-11-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: To be clear: I mean that FastChildWatcher is safe only if all process's code spaws subprocesses by FastChildWatcher. If ProcessPoolExecutor or direct subprocess calls are used the watcher is unsafe. If some C extension spawns new processes on its own

[issue38591] Deprecate Process Child Watchers

2019-11-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: > So are we at least in agreement for starting with deprecating > FastChildWatcher? I think so. It will take a long before we remove it though. -- ___ Python tracker <https://bugs.python.org/i

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2019-11-15 Thread Andrew Ushakov
Andrew Ushakov added the comment: > On Windows, with 3.7, 3.8.0, and master, neither the posted comment, the one > in the file, not the initial statement in #34979 give the SyntaxError. Just tried again on my corporate laptop with the downloaded file from this site: Microsoft W

[issue38823] Improve stdlib module initialization error handling.

2019-11-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: Is anything left to be done for the issue? -- nosy: +asvetlov versions: +Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue38

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

2019-11-18 Thread Andrew Svetlov
Andrew Svetlov added the comment: I see two proposals: 1. Change the default for reuse_address flag 2. Document existing behavior as dangerous. What is the suggestion? Pick one, please :) -- ___ Python tracker <https://bugs.python.org/issue37

[issue38846] async: Return context manager from open(_unix)_connection

2019-11-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: >From my understanding, Yuri doesn't want to improve the existing streaming API >but invent something blessing new. The improvement like you proposed has a very low chance to be accepted. -- ___ Pyt

[issue35409] Async generator might re-throw GeneratorExit on aclose()

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

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