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

2020-01-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: Nice analysis and bug report, thank you! That's pretty strange behaviour for float32, but I guess we're stuck with it. I wonder if the type assertion has outlived its usefulness? I.e. drop the `T == U` part and change the assertion to `assert count == count

[issue39216] ast_opt.c -- missing posonlyargs?

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Hi Anthony, > not sure if this is intentional or not Thanks for the catch! Is not intentional. Could you made a PR adding the line? > Happy to make a patch which adds a line there if someone can help me with the > test We do not have explicit tests

[issue39216] ast_opt.c -- missing posonlyargs?

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: If you want to add a test, you could check the dis output for this example: def make_func(x): def f(x : not (x is x), /): ... In this case the compiler emits: 3 0 LOAD_GLOBAL 0 (x) 2 LOAD_GLOBAL

[issue36051] Drop the GIL during large bytes.join operations?

2020-01-05 Thread Bruce Merry
Bruce Merry added the comment: I've written a variant of the benchmark in which one thread does joins and the other does unrelated CPU-bound work that doesn't touch memory much. It also didn't show much benefit to thresholds below 512KB. I still want to test things on a server-class CPU, but

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

2020-01-05 Thread Mark Dickinson
Mark Dickinson added the comment: [Karthikeyan] > can possibly break again if (x-c) * (x-c) was also changed to return float64 > in future I think it's safe to assume that multiplying two NumPy float32's will continue to give a float32 back in the future; NumPy has no reason to give back a

[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2020-01-05 Thread Mingye Wang
Mingye Wang added the comment: b'\x80'.decode('cp936') is still broken on python 3.7. Working on a PR. -- versions: +Python 3.8, Python 3.9 ___ Python tracker ___

[issue39219] Fix attributes of syntax errors raized in the tokenizer

2020-01-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : SyntaxError can be raised at different stages of compiling. In some places the source text is not available and should be read from the file using the file name. Which does not work in case of compiling a string or reading from stdin. >>> 0z File "", l

[issue39057] Issues with urllib.request.proxy_bypass_environment

2020-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6a265f0d0c0a4b3b8fecf4275d49187a384167f4 by Serhiy Storchaka in branch 'master': bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619) https://github.com/python/cpython/commit/6a265f0d0c0a4b3b8fecf4275d49187a384167f4 -

[issue39057] Issues with urllib.request.proxy_bypass_environment

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17256 pull_request: https://github.com/python/cpython/pull/17829 ___ Python tracker ___ __

[issue39057] Issues with urllib.request.proxy_bypass_environment

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17257 pull_request: https://github.com/python/cpython/pull/17830 ___ Python tracker ___ __

[issue39056] Issues with handling the -W option

2020-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 41ec17e45d54473d32f543396293256f1581e44d by Serhiy Storchaka in branch 'master': bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618) https://github.com/python/cpython/commit/41ec17e45d54473d32f543396293256f1581e44d

[issue39056] Issues with handling the -W option

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17258 pull_request: https://github.com/python/cpython/pull/17831 ___ Python tracker ___ __

[issue39055] base64.b64decode() with validate=True does not raise for a trailing \n

2020-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b19c0d77e6f25ea831ab608c71f15d0d9266c8c4 by Serhiy Storchaka in branch 'master': bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616) https://github.com/python/cpython/commit/b19c0d77e6f25ea831ab608c71f15d0d926

[issue39056] Issues with handling the -W option

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17259 pull_request: https://github.com/python/cpython/pull/17832 ___ Python tracker ___ __

[issue39055] base64.b64decode() with validate=True does not raise for a trailing \n

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17261 pull_request: https://github.com/python/cpython/pull/17834 ___ Python tracker ___ __

[issue39055] base64.b64decode() with validate=True does not raise for a trailing \n

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17260 pull_request: https://github.com/python/cpython/pull/17833 ___ Python tracker ___ __

[issue39057] Issues with urllib.request.proxy_bypass_environment

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset fc84d501b9d77701cbdd485de45e200bf027c0e9 by Miss Islington (bot) in branch '3.8': bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619) https://github.com/python/cpython/commit/fc84d501b9d77701cbdd485de45e200bf027c0e9 --

[issue39057] Issues with urllib.request.proxy_bypass_environment

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset 880a17af7d063fcef225a46b7f4ae35d792b2f11 by Miss Islington (bot) in branch '3.7': bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619) https://github.com/python/cpython/commit/880a17af7d063fcef225a46b7f4ae35d792b2f11 --

[issue39055] base64.b64decode() with validate=True does not raise for a trailing \n

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset 3bdb2d9daf3ce41b325bd508e3dd29041e85dd1f by Miss Islington (bot) in branch '3.7': bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616) https://github.com/python/cpython/commit/3bdb2d9daf3ce41b325bd508e3dd29041e85

[issue39056] Issues with handling the -W option

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset e1caa49f68dd63b534774aebad0c240143e6fb5d by Miss Islington (bot) in branch '3.8': bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618) https://github.com/python/cpython/commit/e1caa49f68dd63b534774aebad0c240143e6fb5d -

[issue39056] Issues with handling the -W option

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset 43fbc70360b2a934ea809b2175d7e99031db2df3 by Miss Islington (bot) in branch '3.7': bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618) https://github.com/python/cpython/commit/43fbc70360b2a934ea809b2175d7e99031db2df3 -

[issue39055] base64.b64decode() with validate=True does not raise for a trailing \n

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset 34aa3e71dc52c1a31336302905b9ac011a310412 by Miss Islington (bot) in branch '3.8': bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616) https://github.com/python/cpython/commit/34aa3e71dc52c1a31336302905b9ac011a31

[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-05 Thread Carl Friedrich Bolz-Tereick
New submission from Carl Friedrich Bolz-Tereick : PEP 563 interacts in weird ways with constant folding. running the following code: ``` from __future__ import annotations def f(a: 5 + 7) -> a ** 39: return 12 print(f.__annotations__) ``` I would expect this output: ``` {'a': '5 + 7',

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-05 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +17262 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/17835 ___ Python tracker ___

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-05 Thread hai shi
hai shi added the comment: One part of this issue is that all C extensions of the stdlib should be updated to implement the PEP 489 "Multi-phase extension module initialization". > I try to port _json extension module to multiphase initialization module, but > the baseline(using victor's code

[issue39057] Issues with urllib.request.proxy_bypass_environment

2020-01-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39055] base64.b64decode() with validate=True does not raise for a trailing \n

2020-01-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39056] Issues with handling the -W option

2020-01-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2020-01-05 Thread Andrew Aladjev
New submission from Andrew Aladjev : Please see the following gentoo bug https://bugs.gentoo.org/704816 https://github.com/python/cpython/blob/master/Lib/lib2to3/pgen2/driver.py#L110 > head + tail + ".".join(map(str, sys.version_info)) + ".pickle" I've tried "print(sys.version_info)" during c

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

2020-01-05 Thread Andrew Aladjev
Andrew Aladjev added the comment: This is build.log: https://gist.githubusercontent.com/andrew-aladev/f36e8e754278e4fad50ff13238326f7a/raw/245a72e8bd0fb3dc6e4185ec757b2d3ab59d5861/gistfile1.txt We can see that python installed "Grammar3.6.9.final.0.pickle" instead of "Grammar3.6.10.final.0.p

[issue39197] argparse: title and description for mutually exclusive arg groups

2020-01-05 Thread hai shi
hai shi added the comment: Do you have user case for it? _ArgumentGroup have the `title` attribute, so _MutuallyExclusiveGroup add same attribute is not a big probleam(if user really need it). -- nosy: +shihai1991 ___ Python tracker

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2020-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I want to merge PR 16814 if there are no objections. -- ___ Python tracker ___ ___ Python-bugs-

[issue37685] Fix equality checks for some types

2020-01-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +17263 pull_request: https://github.com/python/cpython/pull/17836 ___ Python tracker ___

[issue36051] Drop the GIL during large bytes.join operations?

2020-01-05 Thread Bruce Merry
Bruce Merry added the comment: I ran the test on a Xeon machine (Skylake-XP) and it also looks like performance is only improved from 1MB up (somewhat to my surprise, given how poor single-threaded memcpy performance is on that machine). So I've updated the pull request with that threshold.

[issue39216] ast_opt.c -- missing posonlyargs?

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

[issue39222] unittest.mock.Mock.parent is broken or undocumented

2020-01-05 Thread Florian Brucker
New submission from Florian Brucker : The "parent" attribute of unittest.mock.Mock is either broken or undocumented. For example, on Python 3.7.4: >>> from unittest.mock import Mock >>> m = Mock(x=1, parent=2) >>> m.x 1 >>> m.parent Traceback (most recent call last): File "", line 1, in F

[issue39222] unittest.mock.Mock.parent is broken or undocumented

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

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

2020-01-05 Thread Shane
Shane added the comment: A small update: Using the direct invocation: > python -m http.server 8000 Serving HTTP on :: port 8080 (http://[::]:8080/) ... Is NOT accessible at the following addresses: http://[::]:8080/ # most surprising, because this is where it tells you to go http://:8080/

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Batuhan
New submission from Batuhan : >>> def g(): "abcde"[2:4] ... >>> g.__code__.co_consts (None, 'abcde', 2, 4) to >>> def g(): "abcde"[2:4] ... >>> g.__code__.co_consts (None, 'cd') (I have a patch) -- components: Interpreter Core messages: 359350 nosy: BTaskaya priority: normal sever

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Batuhan
Change by Batuhan : -- keywords: +patch pull_requests: +17265 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17838 ___ Python tracker ___

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

2020-01-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 5ea7bb25e3b192d6c49a49c9e3b316f8559602aa by Terry Jan Reedy in branch 'master': bpo-39152: add missing ttk.Scale.configure return value (GH-17815) https://github.com/python/cpython/commit/5ea7bb25e3b192d6c49a49c9e3b316f8559602aa -- __

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

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17266 pull_request: https://github.com/python/cpython/pull/17839 ___ Python tracker ___ __

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: Does this occur often enough that it's worth the added code? -- nosy: +eric.smith ___ Python tracker ___ _

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

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17267 pull_request: https://github.com/python/cpython/pull/17840 ___ Python tracker ___ __

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

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset 6234301bb56a9b388a1c3bf51169a2762ea09172 by Miss Islington (bot) in branch '3.7': bpo-39152: add missing ttk.Scale.configure return value (GH-17815) https://github.com/python/cpython/commit/6234301bb56a9b388a1c3bf51169a2762ea09172 -- n

[issue39216] ast_opt.c -- missing posonlyargs?

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17268 pull_request: https://github.com/python/cpython/pull/17841 ___ Python tracker ___ __

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

2020-01-05 Thread SilentGhost
SilentGhost added the comment: It's the addition of flags=socket.AI_PASSIVE on Lib/http/server.py:1233 that's causing this. I think this also breaks for IPv4 sockets. -- components: +Library (Lib) keywords: +3.8regression nosy: +SilentGhost stage: -> needs patch

[issue39216] ast_opt.c -- missing posonlyargs?

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks again for the fix and the investigation! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset 636a850ed81cf9b8feed523f277b1538bfc5230b by Miss Islington (bot) in branch '3.8': bpo-39152: add missing ttk.Scale.configure return value (GH-17815) https://github.com/python/cpython/commit/636a850ed81cf9b8feed523f277b1538bfc5230b --

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am with Eric. Why would anyone write: "abcde"[2:4] Instead of just cd ? -- nosy: +pablogsal ___ Python tracker ___

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Specially because you need to do the mental calculation to know what the indexes are for the letters you want, and at that point you better write that string anyways, no? -- ___ Python tracker

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

2020-01-05 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 ___ Python tracker ___

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

2020-01-05 Thread Lee Collins
Lee Collins added the comment: I did some more investigation by running cat on a file with the decomposed characters and saw that the output was composed. So, this does look like a problem with the Mac OS terminal. It can be resolved as 3rd party -- resolution: -> third party stage:

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Batuhan
Batuhan added the comment: We already have a folding operation for Index access ("abcde"[2]) and there was a todo (left by @methane I guess) about supporting other slicings. I think this would look inconsistent if one is support and not the other one. --

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

2020-01-05 Thread Berker Peksag
Berker Peksag added the comment: > _markupbase.py is internal, so it should be safe to remove > ParserBase.error() and the code that calls it as suggested in #31844 Should I reopen https://github.com/python/cpython/pull/8562 then? -- ___ Python tra

[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 4b66fa6ce9c37e70b55af220d0e07368319de803 by Pablo Galindo in branch 'master': bpo-39200: Correct the error message for range() empty constructor (GH-17813) https://github.com/python/cpython/commit/4b66fa6ce9c37e70b55af220d0e07368319de803

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: Then I'd suggest removing the optimization for "abcde"[2], too. I've never seen this in real code, and I can't come up with a scenario where it would be performance critical. Remember, one of the goals for CPython is to be reasonable readable, not maximally t

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Batuhan
Batuhan added the comment: > Then I'd suggest removing the optimization for "abcde"[2], too. I've never > seen this in real code, and I can't come up with a scenario where it would be > performance critical. Remember, one of the goals for CPython is to be > reasonable readable, not maximally

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I was reading the pull request and I have to say that I find using a switch instead of a very crowded "if" ward a bit more readable. I would be +0 on this case. -- ___ Python tracker

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Batuhan
Batuhan added the comment: I've scanned stdlib, django and flask and no usage so far. There is one in the test (which basically verifies behavior of slice) and one in the argument clinic which passes the newline for a multiline string. cpython/Tools/clinic/clinic.py:1185 cpython/Lib/test/te

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The one in cpython/Tools/clinic/clinic.py:1185 is sort of an anti-pattern as it should be using '''\ Something something ''' instead of skipping the newline. -- ___ Python tracker

[issue31485] Tkinter widget.unbind(sequence, funcid) unbind all bindings

2020-01-05 Thread Giovanni Lombardo
Giovanni Lombardo added the comment: I propose the below fix: ``` def unbind(self, sequence, funcid=None): """Unbind for this widget for event SEQUENCE the function identified with FUNCID.""" bound = '' if funcid: self.deletecommand(funcid)

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Batuhan
Batuhan added the comment: It looks like we have some usage for normal indexing (not this PR, the original optimization); cpython/cpython/Lib/base64.py:382 cpython/cpython/Lib/base64.py:382 cpython/cpython/Lib/base64.py:393 cpython/cpython/Lib/base64.py:397 cpython/cpython/Lib/pickle.py:306 c

[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-05 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-05 Thread Batuhan
Change by Batuhan : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-05 Thread Batuhan
Change by Batuhan : -- nosy: +BTaskaya -lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue39224] HTTPConnection.timeout None support

2020-01-05 Thread Daniel Farley
New submission from Daniel Farley : HTTPConnection's `timeout` argument is passed down to `socket.settimeout()` which supports `None` and puts the socket in blocking mode. This isn't documented on the `http.client` page. Otherwise it should not be allowed. -- assignee: docs@python com

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

2020-01-05 Thread Ned Deily
Change by Ned Deily : -- nosy: +doko ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/

[issue39224] HTTPConnection.timeout None support

2020-01-05 Thread Daniel Farley
Change by Daniel Farley : -- keywords: +patch pull_requests: +17269 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17843 ___ Python tracker ___ __

[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Łukasz, should we disable AST optimizations in annotations if "from __future__ import annotations" is used? -- nosy: +pablogsal -BTaskaya ___ Python tracker _

[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Yo be honest, this would add a lot of complexity as "from __future__ import annotations" is a compiler directive (CO_FUTURE_ANNOTATIONS) and bringing this to the AST level would be somehow disrupting. I would be -1 to disable AST optimizations in ann

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

2020-01-05 Thread Jason R. Coombs
Jason R. Coombs added the comment: First, a quick primer in IP: - Addresses are written as :::::::, but any single span of zeros can be written as ::, so `::` is all zeros and `::1` is the same as :::::::0001. - ::1 is the local hos

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

2020-01-05 Thread Andrew Aladjev
Andrew Aladjev added the comment: For now I've created a workaround - just removed python version from pickle generator. For my current container it works perfect. -- keywords: +patch Added file: https://bugs.python.org/file48828/remove_python_version_from_pickle.patch _

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

2020-01-05 Thread Jason R. Coombs
Jason R. Coombs added the comment: > It's the addition of flags=socket.AI_PASSIVE on Lib/http/server.py:1233 > that's causing this. Can you elaborate? What is it causing? I can see that flag was added in https://github.com/python/cpython/pull/11767/commits/62dbe55c9d88c75868399de9d86bcd947e

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

2020-01-05 Thread Jason R. Coombs
Jason R. Coombs added the comment: Indeed, if I apply this patch: ``` diff --git a/Lib/http/server.py b/Lib/http/server.py index 47a4fcf9a6..de995ae4b9 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -1246,6 +1246,11 @@ def test(HandlerClass=BaseHTTPRequestHandler, """ Se

[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-05 Thread Jason R. Coombs
Jason R. Coombs added the comment: In issue39211, I've done a good deal of investigation on this issue and confirmed your findings - on Windows, the server fails to bind dual stack on Windows, but instead binds IPV6ONLY. That needs to be fixed such that the default is to bind dual-stack. Add

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

2020-01-05 Thread Shane
Shane added the comment: Jason, thank you for the primer. > Nevertheless, when I tried the same thing on my Windows machine, I got a > different outcome. The server bound to [::0] but was unreachable on > http://127.0.0.1:8000. Perhaps it's an issue with IPv4 addresses in general for Python

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The optimization for constant indexes is handy for things like b'A'[0]. I do not know cases for constant slices of constant strings. Even if there are cases, we need to prove that they are common enough. The compiler does not perform all possible constant

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

2020-01-05 Thread Reed
Reed added the comment: Thank you all for the comments! Either using (x-c)*(x-c), or removing the assertion and changing the final line to `return (U, total)`, seem reasonable. I slightly prefer the latter case, due to Mark's comments about x*x being faster and simpler than x**2. But I am no

[issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8'

2020-01-05 Thread Cheryl Sabella
Change by Cheryl Sabella : -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Even if there are cases, we need to prove that they are common enough I don't think cases for an extended slicing are common enough. In addition to stdlib, Django and flask (checked by Batuhan) I checked many popular 3rd party packages and there is

[issue39223] Fold constant slicing with slices

2020-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Then I suggest to focus on optimizing real code. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39225] Python should warn when a global/local has the same name as a builtin

2020-01-05 Thread Reuven Lerner
New submission from Reuven Lerner : Newcomers to Python are often frustrated and surprised when they define variables such as "sum" and "list", only to discover that they've masked access builtins of the same name. External code checkers do help, but those don't work in Jupyter or other non-

[issue39212] Show qualified function name when giving arguments error

2020-01-05 Thread Ram Rachum
Ram Rachum added the comment: Here is a short IPython session: In [1]: class Foo: ...: def __init__(self, x): ...: pass

[issue39130] Dict is reversable from v3.8 and should say that in the doc

2020-01-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +17270 pull_request: https://github.com/python/cpython/pull/17848 ___ Python tracker ___ __

[issue39130] Dict is reversable from v3.8 and should say that in the doc

2020-01-05 Thread miss-islington
New submission from miss-islington : New changeset 94d9cfc4ed9dd3c4a3a359bc194b4dc3f6ba63eb by Miss Islington (bot) (Khalid Mammadov) in branch 'master': bpo-39130: Dict reversed was added in v3.8 so should say in the doc as well (GH-17694) https://github.com/python/cpython/commit/94d9cfc4ed9

[issue39130] Dict is reversable from v3.8 and should say that in the doc

2020-01-05 Thread miss-islington
miss-islington added the comment: New changeset 89947881ac36324148fab75190af453dc09fd862 by Miss Islington (bot) in branch '3.8': bpo-39130: Dict reversed was added in v3.8 so should say in the doc as well (GH-17694) https://github.com/python/cpython/commit/89947881ac36324148fab75190af453dc0

[issue39226] venv does not include pythonXX.lib

2020-01-05 Thread Antonio Vázquez Blanco
New submission from Antonio Vázquez Blanco : I've tryed to install mod_wsgi using pip lately in a venv. This installation process fails with a message about a missing venv\scripts\libs\python38.lib file as reported in https://github.com/GrahamDumpleton/mod_wsgi/issues/506 It seems that this fi

[issue39225] Python should warn when a global/local has the same name as a builtin

2020-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: On the other hand, this would generate a lot of warnings for users of libraries, who aren't able to do anything about it. I've got tons of existing code that uses the names of builtins as locals, to no harm. And as builtins are added, new warnings would pop u

[issue38623] Python documentation should mention how to find site-packages

2020-01-05 Thread Cheryl Sabella
Change by Cheryl Sabella : -- nosy: +brett.cannon versions: -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python-b

[issue25872] multithreading traceback KeyError when modifying file

2020-01-05 Thread Cheryl Sabella
Cheryl Sabella added the comment: As @xtreak said, this looks like it was fixed for Python 3 and was only an issue for 2.7, so I'm closing the issue. -- nosy: +cheryl.sabella resolution: -> wont fix stage: patch review -> resolved status: open -> closed _

[issue25872] multithreading traceback KeyError when modifying file

2020-01-05 Thread Michael Graczyk
Michael Graczyk added the comment: This issue still exists in Python 3. The repro just needs to be changed so that the threads are actually started. - map(lambda t: t.start(), threads) - map(lambda t: t.join(), threads) + [t.start() for t in threads] + [t.join() for t in threads] My fix is l

[issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine

2020-01-05 Thread Jason R. Coombs
Change by Jason R. Coombs : -- keywords: +patch pull_requests: +17273 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17851 ___ Python tracker _

[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-05 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +17272 pull_request: https://github.com/python/cpython/pull/17851 ___ Python tracker ___ _

[issue20215] socketserver.TCPServer can not listen IPv6 address

2020-01-05 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +17274 pull_request: https://github.com/python/cpython/pull/17851 ___ Python tracker ___ _

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

2020-01-05 Thread Jason R. Coombs
Jason R. Coombs added the comment: Other than addressing issue38907, is there anything else to be done here? In GH-17851, I've proposed a surgical fix to address the issue with IPv4 being unbound on Windows. -- ___ Python tracker

[issue39227] OverflowError in len(range(2**63))

2020-01-05 Thread Zac Hatfield-Dodds
New submission from Zac Hatfield-Dodds : The value for `len` internally passes through an `ssize_t`, which means that it raises OverflowError for (very) large collections. This is admittedly only possible with collections such as `range` that do not store all their elements in memory, but it

[issue38597] C Extension import limit

2020-01-05 Thread Steve Dower
Steve Dower added the comment: I haven't looked into _why_ yet, but the first PYD I grabbed from the GitHub link above has had the CRT statically linked. This is not the default (or it should not be), because when we made it the default this exact issue occurred :) If somehow the default lin

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

2020-01-05 Thread Shane
Shane added the comment: Based on my understanding, your fix should do it. -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue30717] Add unicode grapheme cluster break algorithm

2020-01-05 Thread Manish
Manish added the comment: Hi, Unicodey person here, I'm involved in Unicode itself and also maintain an implementation of this particular spec[1]. So, firstly, > "a⃑".center(width=5, fillchar=".") If you're trying to do terminal width stuff, extended grapheme clusters *will not* solve the

  1   2   >