[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: 'crash' mean *nix coredump or Windows equivelent, rather than traceback. -- components: +Windows nosy: +paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware type: crash -> behavior ___ Python tracker

[issue36665] REPL doesn't ensure builtins are available when implicitly recreating __main__

2019-04-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: To me, the failure of dir() in message 1 is surprising and possibly a bug. I always though of a module globals = locals = dict() instance as continuous across statements, whether in batch or interactive move. In batch mode import sys mod = sys.modules[__nam

[issue36650] Cached method implementation no longer works on Python 3.7.3

2019-04-19 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +12806 stage: -> patch review ___ Python tracker ___ ___ Python-bu

[issue36650] Cached method implementation no longer works on Python 3.7.3

2019-04-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: For the record, here's what is going on. The method_cache() code uses a slightly different invocation for the first call than for subsequent calls. In particular, the wrapper() uses **kwargs with an empty dict whereas the first call didn't use keyword ar

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-19 Thread Windson Yang
Windson Yang added the comment: I can find some example in the docs that didn't `import the correct module` even in the first example. Should we add the `import` statement for all of them? -- nosy: +Windson Yang ___ Python tracker

[issue36643] Forward reference is not resolved by dataclasses.fields()

2019-04-19 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue36666] threading.Thread should have way to catch an exception thrown within

2019-04-19 Thread Joel Croteau
Joel Croteau added the comment: Yes, I know there are workarounds for it, I have seen many, and everyone seems to have their own version. I'm saying we shouldn't need workarounds though–this should be built in functionality. Ideally, dropping an exception should never be default behavior, but

[issue36666] threading.Thread should have way to catch an exception thrown within

2019-04-19 Thread Eric Snow
Eric Snow added the comment: Here's a basic decorator along those lines, similar to one that I've used on occasion: def as_thread(target): def _target(): try: t.result = target() except Exception as exc: t.failure = exc

[issue36666] threading.Thread should have way to catch an exception thrown within

2019-04-19 Thread Joel Croteau
Joel Croteau added the comment: I agree that we should not change the default behavior of Thread.join(), as that would break existing code, but there are plenty of other ways to do this. I see a couple of possibilities: 1. Add an option to the Thread constructor, something like raise_exc, th

[issue33135] Define field prefixes for the various config structs

2019-04-19 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: +nanjekyejoannah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue36650] Cached method implementation no longer works on Python 3.7.3

2019-04-19 Thread Jason R. Coombs
Jason R. Coombs added the comment: Nice work. Thanks Raymond. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue36650] Cached method implementation no longer works on Python 3.7.3

2019-04-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the reproducer code. I've bisected this back to b2b023c657ba8c3f4a24d0c847d10fe8e2a73d44 which fixes other known bugs in the lru_cache in issue 35780. The problem is due to the lines that use a scalar instead of an args tuple for exact ints a

[issue36669] weakref proxy doesn't support the matrix multiplication operator

2019-04-19 Thread SilentGhost
New submission from SilentGhost : It's not obvious why it should. Do you care to show a use case you had in mind? -- components: +Library (Lib) nosy: +SilentGhost, fdrake type: -> enhancement versions: +Python 3.8 ___ Python tracker

[issue35959] math.prod(range(10)) caues segfault

2019-04-19 Thread Mark Dickinson
Mark Dickinson added the comment: I think this can be closed; I did look at the PR post-merge (sorry that I didn't get to it before it was merged), and I agree that it should fix the segfault. There's scope for refactoring / improving the implementation, but that would belong in a different

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Ammar Askar
Ammar Askar added the comment: Thank you, could you also share the output if you just give it the English name of the counter? -- ___ Python tracker ___ _

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Lorenz Mende
Lorenz Mende added the comment: Hi Ammar, you are correct. typeperf returns: P:\Repos\CPython\cpython>typeperf "\System\Prozessor-Warteschlangenlänge" -si 1 "(PDH-CSV 4.0)","\\ZERO\System\Prozessor-Warteschlangenlänge" "04/19/2019 19:09:14.510","0.00" "04/19/2019 19:09:15.514","0.00" S

[issue36617] The rich comparison operators are second class citizens

2019-04-19 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36617] The rich comparison operators are second class citizens

2019-04-19 Thread Eric V. Smith
Eric V. Smith added the comment: I assume the OP is using the stdlib parser module just to show what is a syntax error and what isn't. But most of the characters in the example strings aren't required, so it can be simplified. Here is a simpler case demonstrating what I think the OP is tryin

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Ammar Askar
Ammar Askar added the comment: What does `typeperf "\System\Processor Queue Length" -si 1` actually return on your non-English system? Does it just return an error with the counter's name or is the umalet just in the first header line, i.e this one for me: "(PDH-CSV 4.0)","\\MSI\System\Pr

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Lorenz Mende
Change by Lorenz Mende : -- nosy: -ammar2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Lorenz Mende
Change by Lorenz Mende : -- nosy: +ammar2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-04-19 Thread Lorenz Mende
New submission from Lorenz Mende : The test suite fails with the first tests (I assume 1st call of getloadavg of WindowsLoadTracker). Traceback (most recent call last): File "P:\Repos\CPython\cpython\lib\runpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None,

[issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions

2019-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If the symlink can be recreated, it can also be changed after creation. -- nosy: +serhiy.storchaka ___ Python tracker ___ _

[issue35792] Specifying AbstractEventLoop.run_in_executor as a coroutine conflicts with implementation/intent

2019-04-19 Thread Christopher Hunt
Christopher Hunt added the comment: My use case is scheduling work against an executor but waiting on the results later (on demand). If converting `BaseEventLoop.run_in_executor(executor, func, *args)` to a coroutine function, I believe there are two possible approaches (the discussion that

[issue36669] weakref proxy doesn't support the matrix multiplication operator

2019-04-19 Thread Dan Snider
Change by Dan Snider : -- nosy: bup priority: normal severity: normal status: open title: weakref proxy doesn't support the matrix multiplication operator ___ Python tracker __

[issue36668] semaphore_tracker is not reused by child processes

2019-04-19 Thread SilentGhost
Change by SilentGhost : -- nosy: +davin, pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

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

2019-04-19 Thread Nick Davies
Nick Davies added the comment: > Would you prepare a patch for number 3? I will give it a try and see what I come up with. > I am afraid we can add another hard-to-debug multi-threaded problem by > complicating the data structure. Yeah this was my concern too, the adding and removing from t

[issue36668] semaphore_tracker is not reused by child processes

2019-04-19 Thread Thomas Moreau
Change by Thomas Moreau : -- keywords: +patch pull_requests: +12805 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue36668] semaphore_tracker is not reused by child processes

2019-04-19 Thread Thomas Moreau
New submission from Thomas Moreau : The current implementation of the semaphore_tracker creates a new process for each children. The easy fix would be to pass the _pid to the children but the current mechanism to check if the semaphore_tracker is alive relies on waitpid which cannot be used

[issue36666] threading.Thread should have way to catch an exception thrown within

2019-04-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: The current behavior can't be changed for compatibility reasons (imagine user programs starting to raise on Thread.join()), but we could add an option to the threading.Thread() constructor in order to store and propagate exceptions. -- nosy: +giampao

[issue36666] threading.Thread should have way to catch an exception thrown within

2019-04-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +tim.peters type: -> enhancement versions: +Python 3.8 -Python 3.7 ___ Python tracker ___ ___ P

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-04-19 Thread Nicolas Évrard
Change by Nicolas Évrard : -- nosy: +nicoe ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue36461] timeit: Additional changes for autorange

2019-04-19 Thread Alessandro Cucci
Alessandro Cucci added the comment: Hello @Mariatta, if this is simple I would like to work on that, can I? Thanks! -- nosy: +Alessandro Cucci ___ Python tracker ___ _

[issue20766] reference leaks in pdb

2019-04-19 Thread daniel hahler
daniel hahler added the comment: Please see https://bugs.python.org/issue36667 for a followup. It does not look like moving it to `interaction` is relevant for fixing the leak, is it? I think it should be restored in both places. -- nosy: +blueyed __

[issue36667] pdb: restore SIGINT handler in sigint_handler already

2019-04-19 Thread daniel hahler
Change by daniel hahler : -- keywords: +patch pull_requests: +12804 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue36667] pdb: restore SIGINT handler in sigint_handler already

2019-04-19 Thread daniel hahler
New submission from daniel hahler : Without this, and additional SIGINT while waiting for the next statement (e.g. during `time.sleep`) will stop at `sigint_handler`. With this patch: > …/t-pdb-sigint-in-sleep.py(10)() -> sleep() (Pdb) c ^C Program interrupted. (Use 'cont' t

[issue22135] allow to break into pdb with Ctrl-C for all the commands that resume execution

2019-04-19 Thread daniel hahler
daniel hahler added the comment: Would be nice to have this indeed. Please consider creating a PR with an updated patch then for easier review. -- nosy: +blueyed ___ Python tracker __

[issue36662] asdict/astuple Dataclass methods

2019-04-19 Thread George Sakkis
George Sakkis added the comment: > I think the best thing to do is write another decorator that adds this > method. I've often thought that having a dataclasses_tools third-party module > would be a good idea. I'd be happy with a separate decorator in the standard library for adding these m

[issue14788] Pdb debugs itself after ^C and a breakpoint is set anywhere

2019-04-19 Thread daniel hahler
daniel hahler added the comment: I think this issue itself might be fixed already / changed since 3.5. I've came up with something similar in this area though, which is only triggered when using Ctrl-C while pdb is waiting for the next statement: https://github.com/python/cpython/pull/12880

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-04-19 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Relevant attack from matrix blog post. https://matrix.org/blog/2019/04/18/security-update-sydent-1-0-2/ > sydent uses python's email.utils.parseaddr function to parse the input email > address before sending validation mail to it, but it turns out

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-04-19 Thread Stéphane Bortzmeyer
Stéphane Bortzmeyer added the comment: Note that this bug was used in an actual security attack so it is serious https://medium.com/@fs0c131y/tchap-the-super-not-secure-app-of-the-french-government-84b31517d144 https://twitter.com/fs0c131y/status/1119143946687434753 -- nosy: +bortzmeye

[issue35792] Specifying AbstractEventLoop.run_in_executor as a coroutine conflicts with implementation/intent

2019-04-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: I would rather change the implementation by converting it into async function. It can break some code, sure -- but in a very explicit way (coroutine `run_in_executor is never awaited` error). Making existing third-party code forward-compatible is trivial: just

[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-04-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- resolution: fixed -> status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-04-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue36662] asdict/astuple Dataclass methods

2019-04-19 Thread Eric V. Smith
Eric V. Smith added the comment: I think the best thing to do is write another decorator that adds this method. I've often thought that having a dataclasses_tools third-party module would be a good idea. It could include my add_slots decorator in https://github.com/ericvsmith/dataclasses/blo

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- keywords: +easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Ok, I suggest to add a "first issue" for the sprint days at PyCon US. -- ___ Python tracker ___ _

[issue36295] Need to yield (sleep(0)) twice in asyncio

2019-04-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: In asyncio `await asyncio.sleep(0)` is for switching execution context from the current task to other code. There is no guarantee for finishing already running tasks before returning from `asyncio.sleep(0)` call etc. Also, your code snippet has a logical er

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-19 Thread Eric V. Smith
Eric V. Smith added the comment: I think adding "from dataclasses import dataclass" in the first example is fine. There's a similar import in the sqlite3 documentation, just to pick one at random. -- ___ Python tracker

[issue36662] asdict/astuple Dataclass methods

2019-04-19 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- nosy: +matrixise ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: We could change the example with ``` from dataclasses import dataclass @dataclass class InventoryItem: ... ``` Because it's not specified in the documentation (header, that we need to import dataclass from dataclasses). +1 for a small update. You are

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

2019-04-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: Sorry, I've missed that the loop has hashable requirement already. Would you prepare a patch for number 3? I am afraid we can add another hard-to-debug multi-threaded problem by complicating the data structure. I'm just curious why do you call `all_tasks()`

[issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions

2019-04-19 Thread Tom Hale
Tom Hale added the comment: The most correct work-around I believe exists is: (updates at: https://stackoverflow.com/a/55742015/5353461) def symlink_force(target, link_name): ''' Create a symbolic link pointing to target named link_name. Overwrite target if it exis