[issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array

2020-01-04 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I think it's more of an implementation artifact of numpy eq definition for float32 and float64 and can possibly break again if (x-c) * (x-c) was also changed to return float64 in future. -- nosy: +rhettinger, steven.daprano, taleinat,

[issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array

2020-01-04 Thread Reed
New submission from Reed : If a float32 Numpy array is passed to statistics.variance(), an assertion failure occurs. For example: import statistics import numpy as np x = np.array([1, 2], dtype=np.float32) statistics.variance(x) The assertion error is: assert T == U and

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Jan 05, 2020 at 02:19:49AM +, Tim Peters wrote: > Since, best I can recall, nobody has asked about this before See discussion here: https://mail.python.org/archives/list/python-...@python.org/message/5AQMG6ADD6RGPLI3VTILB2MKXMBFTIGU/ which

[issue39174] unicodedata.normalize failing with NFD and NFKD for some characters in Python3

2020-01-04 Thread Inada Naoki
Inada Naoki added the comment: I can not get what you say. If "unicodedata.normalize() produces the correct sequence", isn't it just a your terminal behavior? If you think it is Python's issue, could you be more specific and write a simple sample code? -- nosy: +inada.naoki

[issue39198] Lock may not be released in Logger.isEnabledFor

2020-01-04 Thread Ned Deily
Change by Ned Deily : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39216] ast_opt.c -- missing posonlyargs?

2020-01-04 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Tim Peters
Tim Peters added the comment: It's hard to be clearer without being annoyingly wordy. The truth is that sort does all comparisons by calling the CAPI: PyObject_RichCompareBool(v, w, Py_LT)` Sorting doesn't know (or care) how `PyObject_RichCompareBool()` is implemented. The closest

[issue39215] Type Annotation of nested function with positional only arguments triggers SystemError

2020-01-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks, Anthony, for the quick fix and the investigation! :) -- nosy: +pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39217] GC of a ctypes object causes application crash

2020-01-04 Thread Kevin Schlossser
New submission from Kevin Schlossser : I guess this is a question as much as it is a bug report. I know that all kinds of strange behavior can happen when using ctypes improperly. This is what is taking place. I can provide code if needed. but lets work off of my description of what is

[issue39215] Type Annotation of nested function with positional only arguments triggers SystemError

2020-01-04 Thread miss-islington
Change by miss-islington : -- pull_requests: +17255 pull_request: https://github.com/python/cpython/pull/17827 ___ Python tracker ___

[issue39216] ast_opt.c -- missing posonlyargs?

2020-01-04 Thread Anthony Sottile
New submission from Anthony Sottile : while fixing bpo-39215, I noticed that there seems to be a place here where posonlyargs was missed: https://github.com/python/cpython/blob/7dc72b8d4f2c9d1eed20f314fd6425eab66cbc89/Python/ast_opt.c#L617-L627 not sure if this is intentional or not -- happy

[issue39215] Type Annotation of nested function with positional only arguments triggers SystemError

2020-01-04 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +17254 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17826 ___ Python tracker ___

[issue22543] -W option cannot use non-standard categories

2020-01-04 Thread Feng Yu
Feng Yu added the comment: Coming here from https://github.com/astropy/astropy/issues/9832#issuecomment-570751353 Importing the named module during warning initialization is somewhat like code injection. And it may introduce unintended side-effects -- for example if this causes some 3rd

[issue39215] Type Annotation of nested function with positional only arguments triggers SystemError

2020-01-04 Thread Anthony Sottile
Anthony Sottile added the comment: this triggers an assertion when run with debug enabled: $ gdb ./python GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is

[issue38597] C Extension import limit

2020-01-04 Thread Kevin Schlossser
Kevin Schlossser added the comment: Thank you msg356892 for spear heading this for me. I family things to attend to so I apologize for opening this bug report and then walking away.. As far as recreating this issue. It simple to do. you can either use cython or you can put together a quick

[issue39215] Type Annotation of nested function with positional only arguments triggers SystemError

2020-01-04 Thread Anthony Sottile
Anthony Sottile added the comment: Looks as though annotations are using `LOAD_NAME` when they should probably use `LOAD_GLOBAL`? ``` $ diff -u <(python3.9 -m dis t2.py | sed 's/0x[a-f0-9]*/0xdeadbeef/g;s/t2\.py/FILENAME/g') <(python3.9 -m dis t3.py | sed

[issue39215] Type Annotation of nested function with positional only arguments triggers SystemError

2020-01-04 Thread Anthony Sottile
New submission from Anthony Sottile : def f(): def g(arg: int, /): pass f() $ python3.9 t2.py Traceback (most recent call last): File "/home/asottile/workspace/t2.py", line 5, in f() File "/home/asottile/workspace/t2.py", line 2, in f def g(arg: int, /): SystemError:

[issue39184] Many command execution functions are not raising auditing events

2020-01-04 Thread Saiyang Gou
Saiyang Gou added the comment: I have made PR 17824 to add auditing events for the command execution functions mentioned above. After a review on other related Python modules, I think maybe the following functions can also be audited, but a discussion may be required to determine whether

[issue39214] Add curses.window.in_wch

2020-01-04 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +17253 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17825 ___ Python tracker ___

[issue39184] Many command execution functions are not raising auditing events

2020-01-04 Thread Saiyang Gou
Change by Saiyang Gou : -- keywords: +patch pull_requests: +17252 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17824 ___ Python tracker ___

[issue39212] Show qualified function name when giving arguments error

2020-01-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: > builtins.TypeError: __init__() takes 1 positional argument but 2 were given How did you get the fully qualified exception? I just get "TypeError". (Also the error message is different in 3.8.) > It was annoying that I didn't know which `__init__` method

[issue39214] Add curses.window.in_wch

2020-01-04 Thread Anthony Sottile
New submission from Anthony Sottile : (I've already got a patch for this, just making the necessary issue) curses.window.inch is pretty useless for any non-ascii character -- components: Extension Modules messages: 359309 nosy: Anthony Sottile priority: normal severity: normal status:

[issue39211] Change in http.server default IP behavior?

2020-01-04 Thread Shane
Shane added the comment: For the basic invocation: >python -m http.server 8080 Serving HTTP on :: port 8080 (http://[::]:8080/) ... It just sits there, because I can't access it (http://[::]:8080/ is not a valid address, so far as I know, and inserting my IP address doesn't find it either).

[issue11416] netrc module does not handle multiple entries for a single host

2020-01-04 Thread Frew Schmidt
Change by Frew Schmidt : -- nosy: -Frew Schmidt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39182] sys.addaudithook(hook) loops indefinitely on mismatch for hook

2020-01-04 Thread Steve Dower
Steve Dower added the comment: Right, IDLE doesn't call exec/compile until _after_ the code is submitted, while the regular prompt calls it first and passes stdin as the source file (which then does a buffered read). The loop occurs because the next action after an invalid input is to read

[issue39152] Faulty override of tkinter.Misc.configure in tkinter.ttk.Scale.configure

2020-01-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Giovanni, I saw that you gave a correct fix even if your example was wrong. Currently, scale.configure returns None instead of the configuration. Your patch fixes this. Once I created a git branch to verify and test the fix, it was trivial to make a PR,

[issue39213] cmd should have a hook in the finally block of cmdloop

2020-01-04 Thread Joseph Sible
New submission from Joseph Sible : Currently, the cmdloop function in cmd has a preloop hook, which runs before the large try block, and a postloop hook, which runs at the end of the body of the large try block. This isn't sufficient for subclasses to safely use

[issue39165] Completeness and symmetry in RE, avoid `findall(...)[0]`

2020-01-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: After reading Serhiy's clarification of the old and wonky findall return api, I agree that reusing it in an unneeded new function would be a retrograde move. We should instead upgrade the documentation of the more flexible current functions. For search,

[issue39211] Change in http.server default IP behavior?

2020-01-04 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +jaraco ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39211] Change in http.server default IP behavior?

2020-01-04 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Can you please paste the output of http.server as in the port and address printed as a log when started for different commands? As I can see from the history the binding process was changed to include IPv6 as default :

[issue39212] Show qualified function name when giving arguments error

2020-01-04 Thread Ram Rachum
New submission from Ram Rachum : I recently got this familiar error: builtins.TypeError: __init__() takes 1 positional argument but 2 were given It was annoying that I didn't know which `__init__` method was under discussion. I wish that Python used the `__qualname__` of the function to

[issue39211] Change in http.server default IP behavior?

2020-01-04 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2020-01-04 Thread Josh Kamdjou
Josh Kamdjou added the comment: (Author of PR https://github.com/python/cpython/pull/17643) Since the behavior of self.error() is determined by the subclass implementation, an Exception is not guaranteed. How should this be handled? It seems the options are: - continue execution, in which

[issue39211] Change in http.server default IP behavior?

2020-01-04 Thread Shane
New submission from Shane : It seems to me that the direct invocation behavior for http.server changed, probably with Python 3.8 (I'm currently using 3.8.1 on Windows 10). On 3.7.X I was able to use it as described in the docs (https://docs.python.org/3/library/http.server.html) > python -m

[issue39211] Change in http.server default IP behavior?

2020-01-04 Thread Shane
Change by Shane : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38973] Shared Memory List Returns 0 Length

2020-01-04 Thread Derek Frombach
Change by Derek Frombach : Removed file: https://bugs.python.org/file48757/20191203_194951.jpg ___ Python tracker ___ ___ Python-bugs-list

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Mark Dickinson
Mark Dickinson added the comment: Right, the HOWTO language could possibly be improved. The intended and practical message is that you *only* need to provide __lt__ everywhere for sort to work. -- nosy: +rhettinger, tim.peters ___ Python tracker

[issue11416] netrc module does not handle multiple entries for a single host

2020-01-04 Thread Tibor Baranya
Change by Tibor Baranya : -- pull_requests: +17249 pull_request: https://github.com/python/cpython/pull/17823 ___ Python tracker ___

[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2020-01-04 Thread Josh Kamdjou
Change by Josh Kamdjou : -- keywords: +patch pull_requests: +17250 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/17643 ___ Python tracker

[issue11416] netrc module does not handle multiple entries for a single host

2020-01-04 Thread Tibor Baranya
Tibor Baranya added the comment: Just for further clarification on how .netrc is supposed to work, I tested some other implementations. Sorry if this comment gets too long, but it seems netrc is not really a standardized solution. In my last comment I referred curl and wget, but of course

[issue27657] urlparse fails if the path is numeric

2020-01-04 Thread Ned Deily
Change by Ned Deily : -- keywords: +3.7regression, 3.8regression -patch priority: normal -> deferred blocker ___ Python tracker ___

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Yan Mitrofanov
Yan Mitrofanov added the comment: I got your point. So it seems that two pieces of documentation are not equivalent: https://docs.python.org/3/howto/sorting.html#odd-and-ends > The sort routines are guaranteed to use __lt__() when making comparisons > between two objects.

[issue35292] Make SimpleHTTPRequestHandler load mimetypes lazily

2020-01-04 Thread AnLong
Change by AnLong : -- pull_requests: +17248 pull_request: https://github.com/python/cpython/pull/17822 ___ Python tracker ___ ___

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Mark Dickinson
Mark Dickinson added the comment: To be precise, when doing `a < b`, either `a.__lt__` or `b.__gt__` can be used, since `__gt__` is considered the reversed / reflected version of `__lt__` (analogous to `__add__` and `__radd__`). >>> class A: ... def __lt__(self, other): return False

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: The `<` comparison uses `__lt__` dunder if it exists, otherwise it falls back on `__gt__`. -- nosy: +steven.daprano ___ Python tracker ___

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Yan Mitrofanov
New submission from Yan Mitrofanov : Sorting documentation claims that sorting algorithm is only using < comparisons https://docs.python.org/3/howto/sorting.html#odd-and-ends https://docs.python.org/3/library/stdtypes.html#list.sort When __lt__ implementation is missing, you get an exception

[issue39158] ast.literal_eval() doesn't support empty sets

2020-01-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > And if add support of non-literals, where should we stop? Should we support > also frozenset() and bytearray()? inf and nan? infj and nanj? complex()? > Ellipsis? __debug__? Then the name of the function would be a bit misleading (for frozenset()

[issue33095] Cross-reference isolated mode from relevant locations

2020-01-04 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Closing since PRs were merged. Thanks for the review. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39209] Crash on REPL mode with long text copy and paste

2020-01-04 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +serhiy.storchaka, vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39209] Crash on REPL mode with long text copy and paste

2020-01-04 Thread Dong-hee Na
New submission from Dong-hee Na : When I copy and paste the pretty long text into REPL shell. REPL shell is crash down with segment fault. This issue is only reproducible on macOS, but Linux REPL doesn't look like normal behavior. [origin text]

[issue39152] Faulty override of tkinter.Misc.configure in tkinter.ttk.Scale.configure

2020-01-04 Thread Giovanni Lombardo
Giovanni Lombardo added the comment: @serhiy.storchaka I didn't found any old issue not closed aboud tkinter Scale widget. -- ___ Python tracker ___

[issue39152] Faulty override of tkinter.Misc.configure in tkinter.ttk.Scale.configure

2020-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a special case in tests for Scale.configure. It should be removed now. And maybe there is an old issue for this? -- ___ Python tracker

[issue39152] Faulty override of tkinter.Misc.configure in tkinter.ttk.Scale.configure

2020-01-04 Thread Giovanni Lombardo
Giovanni Lombardo added the comment: Hello Terry J. Reedy, first and foremost thanks for the time you've dedicated to this issue! I really appreciate you work!! Even if I work with Python since 2007, I'm new here, and not very well versed with this issue management system. This has been my

[issue39158] ast.literal_eval() doesn't support empty sets

2020-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The documentation for ast.literal_eval(): Safely evaluate an expression node or a string containing a Python literal or container display. The string or node provided may only consist of the following Python literal structures: strings, bytes,

[issue39165] Completeness and symmetry in RE, avoid `findall(...)[0]`

2020-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your implementation takes several lines of code only because of complex semantic of findall() which you want to preserve in findfirst(). Actually findall() is an equivalent of one of three expressions, depending on the number of capturing groups in the

[issue28367] Add more standard baud rate constants to "termios"

2020-01-04 Thread Thomas Wouters
Thomas Wouters added the comment: New changeset 7dc72b8d4f2c9d1eed20f314fd6425eab66cbc89 by T. Wouters (Anthony Shaw) in branch 'master': bpo-28367: Add additional baud rates for termios (GH-13142) https://github.com/python/cpython/commit/7dc72b8d4f2c9d1eed20f314fd6425eab66cbc89 --

[issue28367] Add more standard baud rate constants to "termios"

2020-01-04 Thread Thomas Wouters
Change by Thomas Wouters : -- stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.7 ___ Python tracker ___

[issue39165] Completeness and symmetry in RE, avoid `findall(...)[0]`

2020-01-04 Thread Juancarlo Añez
Juancarlo Añez added the comment: There's no way to assert that `findall(...)[0]` is efficient enough in most cases. It is easy to see that that it is risky in every case, as runtime may be exponential, and memory O(len(input)). A mistake in the regular expression may easily result in an

[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-04 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 9c145e19fba53369da5cd23a1e71de489836f827 by Andrew Svetlov in branch '3.7': [3.7] bpo-39191: Don't spawn a task before failing (GH-17796) (#17821) https://github.com/python/cpython/commit/9c145e19fba53369da5cd23a1e71de489836f827 --

[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 867d8333ce6a7f74191ad464acc609d4a04e4acb by Andrew Svetlov in branch '3.8': [3.8] bpo-39191: Don't spawn a task before failing (GH-17796) (GH-17820) https://github.com/python/cpython/commit/867d8333ce6a7f74191ad464acc609d4a04e4acb --

[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-04 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +17247 pull_request: https://github.com/python/cpython/pull/17821 ___ Python tracker ___

[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-04 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +17246 pull_request: https://github.com/python/cpython/pull/17820 ___ Python tracker ___