[issue46161] Incorrect bytecpde compilation for class

2021-12-22 Thread zq
New submission from zq : Please refer to https://github.com/python/cpython/pull/30235 -- messages: 409069 nosy: zq1997 priority: normal pull_requests: 28456 severity: normal status: open title: Incorrect bytecpde compilation for class type: compile error

[issue46160] IPy->IPSet AttributeError: module 'collections' has no attribute 'MutableSet'

2021-12-22 Thread dafu-wu
New submission from dafu-wu : Traceback (most recent call last): File "/Users/jackwu/zhiyun/mygit/webgw/manage.py", line 5, in from webgw.settings import DEBUG File "/Users/jackwu/zhiyun/mygit/webgw/webgw/__init__.py", line 1, in from .app import app File

[issue46158] Hardcoded sysroot path, to MacOSX11.sdk, in python sysconfig

2021-12-22 Thread Aditya Kumar
Aditya Kumar added the comment: while installing pycryptodome, the package is built from source. Because no toolchain is found build fails with the following error. To work around this issue temporarily i created a symlink MacOSX11.1.sdk -> MacOSX.sdk but it is not possible to do this on

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Eryk Sun
Eryk Sun added the comment: > That's taken straight out of the documentation. Yes, but it's still a misleading comparison. > Until I understood that exec with two different mapping objects as > globals and locals behaves as if the code where embedded inside a > class, I found the reported

[issue46158] Hardcoded sysroot path, to MacOSX11.sdk, in python sysconfig

2021-12-22 Thread Ned Deily
Ned Deily added the comment: Whether or not a macOS sysroot path is included in CFLAGS depends on how the Python build was configured and built. For instance, the macOS Python binaries provided on python.org do not include a sysroot path in CFLAGS; from the version info provided, you are

[issue46148] Optimize pathlib

2021-12-22 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46148] Optimize pathlib

2021-12-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: I have https://github.com/python/cpython/pull/27828 open already to add vectorcall to itemgetter and attrgetter -- nosy: +Dennis Sweeney ___ Python tracker

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Dec 23, 2021 at 12:15:29AM +, Eryk Sun wrote: > > Eryk Sun added the comment: > > > If exec gets two separate objects as globals and locals, > > the code will be executed as if it were embedded in a > > class definition. > > That's a

[issue37295] Possible optimizations for math.comb()

2021-12-22 Thread Tim Peters
Tim Peters added the comment: No problem, Mark! I just prefer the shallowest approaches that are "good enough". If it's materially faster to use xors and a popcount instead, fine by me, just provided a comment points to a clue about why that works. BTW, the later xor version was clearer to

[issue46159] Segfault when using trace functions in 3.11a3

2021-12-22 Thread Alex Gaynor
Change by Alex Gaynor : -- components: +Interpreter Core nosy: +Mark.Shannon, alex ___ Python tracker ___ ___ Python-bugs-list

[issue46159] Segfault when using trace functions in 3.11a3

2021-12-22 Thread Paul Kehrer
Change by Paul Kehrer : -- title: Segfault -> Segfault when using trace functions in 3.11a3 ___ Python tracker ___ ___

[issue46159] Segfault

2021-12-22 Thread Paul Kehrer
New submission from Paul Kehrer : In Python 3.11a3 on Linux/x86_64 (failed to replicate on macOS, not attempted on Windows) the interpreter non-deterministically segfaults when running some code under coverage. This did not occur under 3.11a2. Looking at the backtrace from a core dump I see:

[issue46146] Python IDLE fails to start (tk font issue?)

2021-12-22 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +epaine, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46148] Optimize pathlib

2021-12-22 Thread Guido van Rossum
Guido van Rossum added the comment: > Note: attrgetter could easily be made faster by migrating it to use > vectorcall. Sure, though code that *doesn't* use attrgetter is usually easier to read -- attrgetter is rare enough in my experience that I usually have to look it up. So making

[issue46148] Optimize pathlib

2021-12-22 Thread Josh Rosenberg
Josh Rosenberg added the comment: Note: attrgetter could easily be made faster by migrating it to use vectorcall. -- nosy: +josh.r ___ Python tracker ___

[issue46090] C extensions can't swap out live frames anymore

2021-12-22 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +28455 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30234 ___ Python tracker ___

[issue46090] C extensions can't swap out live frames anymore

2021-12-22 Thread Brandt Bucher
Brandt Bucher added the comment: After further discussion with the team this morning, we decided that the proposed "dummy chunk" workaround is unacceptable (the interpreter may end up trying free it when shutting down a thread). Allowing the tstate->datastack_* members to be NULL is very

[issue46158] Hardcoded sysroot path, to MacOSX11.sdk, in python sysconfig

2021-12-22 Thread Aditya Kumar
New submission from Aditya Kumar : $ python3.9 Python 3.9.7 (default, Sep 3 2021, 12:37:55) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin >>> import sysconfig >>> cflags = sysconfig.get_config_var('CFLAGS') >>> cflags '-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2021-12-22 Thread Thomas Grainger
Thomas Grainger added the comment: actually it was already done in 13 months! -- ___ Python tracker ___ ___ Python-bugs-list

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2021-12-22 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert nosy_count: 3.0 -> 4.0 pull_requests: +28454 pull_request: https://github.com/python/cpython/pull/30233 ___ Python tracker ___

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Eryk Sun
Eryk Sun added the comment: > If exec gets two separate objects as globals and locals, > the code will be executed as if it were embedded in a > class definition. That's a misleading comparison because a class definition intentionally supports nonlocal closures, which exec() doesn't

[issue46146] Python IDLE fails to start (tk font issue?)

2021-12-22 Thread Christoph Feck
Christoph Feck added the comment: (original bug reporter replying, thanks Matej for pointing me here!) > what OS and font gives this error? OS is openSUSE Tumbleweed 20211202, which has these versions: - python 3.8.12 - tcl/tk 8.6.12 - fontconfig 2.13.1 - adobe-sourcecodepro-fonts 2.030

[issue46146] Python IDLE fails to start (tk font issue?)

2021-12-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: Serhiy: Matej Cepl (SUSE) asks about tk and Wayland switch. Do you know anything? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue46148] Optimize pathlib

2021-12-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46156] 3.9.9: python built-in SSL module unable to connect to an IIS server (104 Connection reset by peer), but pyopenssl works fine

2021-12-22 Thread Christian Heimes
Christian Heimes added the comment: I need more information to diagnose the issue. Could you please provide: - your operating system and vendor/distribution - your OpenSSL version (ssl.OPENSSL_VERSION) - how did you install Python (self-compiled, pyenv, system Python)? - how did you install

[issue45235] argparse does not preserve namespace with subparser defaults

2021-12-22 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46157] Typo in JSON documentation

2021-12-22 Thread Jordan Bonecutter
New submission from Jordan Bonecutter : In this doc: https://docs.python.org/3/library/json.html#json.dump The section on check_circular has a typo: ...a circular reference will result in an RecursionError => a RecursionError -- assignee: docs@python components: Documentation

[issue46156] 3.9.9: python built-in SSL module unable to connect to an IIS server (104 Connection reset by peer), but pyopenssl works fine

2021-12-22 Thread lkraav
New submission from lkraav : Problems emerged when Requests phased out PyOpenSSL as their default backend https://github.com/psf/requests/blob/main/HISTORY.md#2240-2020-06-17 Suddenly my script wasn't able to connect to a remote server that it had been working with for years. All connection

[issue46155] Implement ExceptionGroup __new__

2021-12-22 Thread Irit Katriel
Irit Katriel added the comment: False alarm, this is already as it should be. Me needs a couple of weeks offline is all it is. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue46148] Optimize pathlib

2021-12-22 Thread Guido van Rossum
Guido van Rossum added the comment: I presume https://github.com/faster-cpython/ideas/discussions/194 is also relevant. -- ___ Python tracker ___

[issue46155] Implement ExceptionGroup __new__

2021-12-22 Thread Irit Katriel
Change by Irit Katriel : -- assignee: -> iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46155] Implement ExceptionGroup __new__

2021-12-22 Thread Irit Katriel
New submission from Irit Katriel : Currently ExceptionGroup inherits __new__ from BaseExceptionGroup, it should have its own __new__ implementation which raises a TypeError if any contained exception is not an Exception subclass. -- messages: 409047 nosy: gvanrossum, iritkatriel,

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: "Expected" is a strong word. It took me a lot of careful reading of the documentation and experimentation to decide that, yes, I expect the second case to fail when the first case succeeds. Which reminds me of a common anecdote from mathematics:

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Quentin Peter
Quentin Peter added the comment: Thank you for your explaination. Just to be sure, it is expected that: exec("a = 1\ndef f(): return a\nprint(f())", {}) Runs successfully but exec("a = 1\ndef f(): return a\nprint(f())", {}, {}) Doesn't? -- ___

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I now want to define a closure with exec. I might want to do something like: > exec("def f(): return a", globals(), locals()) That doesn't create a closure. > I would expect f() to look for a in the locals(). I'm sorry, but your expectation that f()

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Here is the key phrase in the docs: "If exec gets two separate objects as globals and locals, the code will be executed as if it were embedded in a class definition." https://docs.python.org/3/library/functions.html#exec And sure enough: >>> class C: ...

[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-22 Thread Sebastian Rittau
Change by Sebastian Rittau : -- nosy: +srittau ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Quentin Peter
Quentin Peter added the comment: The reason I am asking is that I am working on a debugger. The debugger stops on a frame which is inside a function. Let's say the locals is: locals() == {"a": 1} I now want to define a closure with exec. I might want to do something like: exec("def f():

[issue46154] MIMEMultipart enforces line endings also for binary subparts

2021-12-22 Thread Sophonet
New submission from Sophonet : For an activity with fastapi, I am preparing a Response object with the content of a email.mime.multipart MIMEMultipart object. Adhering to the standards (RFC), a MIMEMultipart response uses CRLF line endings (policy=HTTP). However, the binary attachment I am

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: The function you use in exec is not a closure. The function: def f(): return a does not capture the top-level variable "a", it does a normal name lookup for a. You can check this yourself by looking at f.__closure__ which you will see is None.

[issue46153] closure fails in exec when locals is given

2021-12-22 Thread Quentin Peter
Quentin Peter added the comment: This might be related to https://bugs.python.org/issue41918 -- ___ Python tracker ___ ___

[issue46153] closure fails in exec when locals is given

2021-12-22 Thread Quentin Peter
New submission from Quentin Peter : When both namespace arguments are given to exec, function definitions fail to capture closure. See below: ``` Python 3.8.6 (default, Oct 8 2020, 14:06:32) [Clang 12.0.0 (clang-1200.0.32.2)] on darwin Type "help", "copyright", "credits" or "license" for

[issue46152] rename wave.py class nane

2021-12-22 Thread Christian Heimes
Christian Heimes added the comment: Backwards incompatible changes are out of scope. -- nosy: +christian.heimes resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker

[issue46152] rename wave.py class nane

2021-12-22 Thread 清者自清
Change by 清者自清 : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46152] rename wave.py class nane

2021-12-22 Thread 清者自清
New submission from 清者自清 : Wave_read/Wave_write is ugly, change to WaveReader/WaveWriter? -- messages: 409036 nosy: a1025952421 priority: normal severity: normal status: open title: rename wave.py class nane type: performance versions: Python 3.10, Python 3.11

[issue46151] SimpleCookie.js_output is vulnerable to HTML injection

2021-12-22 Thread Trung Pham
New submission from Trung Pham : In /Lib/http/cookies.py, the output from SimpleCookie.js_output might be parsed as HTML if it contained < and >. ``` from http import cookies c = cookies.SimpleCookie() c["fig"] = "newtonalert(document.domain)"; // c.js_output()