[issue45054] json module should issue warning about duplicate keys

2021-08-30 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45056] compiler: Unnecessary None in co_consts

2021-08-30 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-08-30 Thread Ned Deily
Ned Deily added the comment: New changeset 79101b890ee021a901a8b6837a3a320d57adb725 by Łukasz Langa in branch '3.7': [3.7] bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) (GH-28042) https://github.com/python/cpython/commit/79101b890ee021a901a8b6837a3a320d57adb725 --

[issue45021] Race condition in thread.py

2021-08-30 Thread hai shi
hai shi added the comment: Is it a defined behavior? I got this sentence from pep-3148: Deadlock can occur when the callable associated with a Future waits on the results of another Future. -- nosy: +shihai1991 ___ Python tracker

[issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows

2021-08-30 Thread Eryk Sun
Eryk Sun added the comment: > It may be a bug in the constructor of SharedMemory. It ignores > the size argument on Windows. The `size` argument is always ignored when `create` is false, on all platforms, not that I understand the reason for it. The difference compared to POSIX is that the

[issue45056] compiler: Unnecessary None in co_consts

2021-08-30 Thread Inada Naoki
Inada Naoki added the comment: I think LOAD_CONST None + RETURN_VALUE is added here. And it removed by optimize_cfg(). https://github.com/python/cpython/blob/793f55bde9b0299100c12ddb0e6949c6eb4d85e5/Python/compile.c#L7795-L7797 I don't know how easy to remove this unnecessary None. But

[issue45056] compiler: Unnecessary None in co_consts

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: I wonder what the 3.10 compiler does different to cause this -- in 3.9 that extra None is not in co_consts. (Note: Mark is on vacation for 2 weeks.) -- nosy: +Mark.Shannon, gvanrossum ___ Python tracker

[issue44983] Wrong definition of a starred expression in the Language Reference

2021-08-30 Thread Takuo Matsuoka
Takuo Matsuoka added the comment: Thanks Éric Araujo, for the information. Actually, I sought for a similar issue here in the tracker, but didn't find one filed, so this report appears to be unique. -- ___ Python tracker

[issue42414] unable to document fields of dataclass

2021-08-30 Thread Laurie Opperman
Laurie Opperman added the comment: No new mailing list thread, but there is one from January 2020: https://mail.python.org/archives/list/python-id...@python.org/thread/RHB6XFGFVM66AZTRKNTBAKFEVVEYUDD3/ -- nosy: +Epic_Wink ___ Python tracker

[issue36521] Consider removing docstrings from co_consts in code objects

2021-08-30 Thread Inada Naoki
Inada Naoki added the comment: This is WIP pull request. https://github.com/methane/cpython/pull/35 Some tests are failing because of bpo-36521. -- ___ Python tracker ___

[issue45056] compiler: Unnecessary None in co_consts

2021-08-30 Thread Inada Naoki
New submission from Inada Naoki : Python 3.10 compiler adds None to co_consts even when None is not used at all. ``` $ cat x1.py def foo(): "docstring" return 42 import dis dis.dis(foo) print(foo.__code__.co_consts) $ python3.9 x1.py 3 0 LOAD_CONST 1 (42)

[issue36521] Consider removing docstrings from co_consts in code objects

2021-08-30 Thread Inada Naoki
Inada Naoki added the comment: I grepped top 5000 downloaded packages and I can not find any real use of PyFunction_New(WithQualName). So I don't know what is current workflow of PyFunction_New. My current wip implementation adds new API (e.g. PyFunction_NewWithDoc()). Old API keep using

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

2021-08-30 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2021-08-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 793f55bde9b0299100c12ddb0e6949c6eb4d85e5 by Raymond Hettinger in branch 'main': bpo-39218: Improve accuracy of variance calculation (GH-27960) https://github.com/python/cpython/commit/793f55bde9b0299100c12ddb0e6949c6eb4d85e5 --

[issue45055] Fresh build on Windows fails the first time for zlib.c

2021-08-30 Thread Guido van Rossum
New submission from Guido van Rossum : When I make a fresh checkout of the main branch on Windows and type "pcbuild\build" it starts downloading some distributions (e.g. sqlite) and then starts building. Fine. But at some point there's a whole bunch of errors that seem to come from building

[issue45054] json module should issue warning about duplicate keys

2021-08-30 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +bob.ippolito ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45019] Freezing modules has manual steps but could be automated.

2021-08-30 Thread Eric Snow
Eric Snow added the comment: I'm just waiting for the buildbots to finish. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue45054] json module should issue warning about duplicate keys

2021-08-30 Thread Kevin Mills
New submission from Kevin Mills : The json module will allow the following without complaint: import json d1 = {1: "fromstring", "1": "fromnumber"} string = json.dumps(d1) print(string) d2 = json.loads(string) print(d2) And it prints: {"1": "fromstring", "1": "fromnumber"} {'1':

[issue45019] Freezing modules has manual steps but could be automated.

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: Is this ready to close? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45019] Freezing modules has manual steps but could be automated.

2021-08-30 Thread Eric Snow
Eric Snow added the comment: New changeset 044e8d866fdde3804bdb2282c7d23a8074de8f6f by Eric Snow in branch 'main': bpo-45019: Add a tool to generate list of modules to include for frozen modules (gh-27980) https://github.com/python/cpython/commit/044e8d866fdde3804bdb2282c7d23a8074de8f6f

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-08-30 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +26521 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28077 ___ Python tracker

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Eric Snow
Eric Snow added the comment: On Mon, Aug 30, 2021 at 2:22 PM Guido van Rossum wrote: > I propose to only opt in by default in **PGO builds**. After all what we're > doing is another extreme optimization. > > It should always be possible to opt in using some -X flag (e.g. to debug the >

[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docs lie)

2021-08-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: > So I really *do* want to see the ability of __float__ > to return a non-float eventually removed. Note, the __str__ method on strings does not require an exact str. class S: def __str__(self): return self

[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 9ef1843892500e209afe5d916db26ecdbccd5e62 by Łukasz Langa in branch '3.9': bpo-44756: Remove misleading NEWS entries of a change that was reverted before release (GH-28075)

[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 5246dbc2a12bf8e64e18efee2fdce02a350bbf09 by Łukasz Langa in branch 'main': bpo-44756: Remove misleading NEWS entries of a change that was reverted before release (GH-28075)

[issue39452] Improve the __main__ module documentation

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks, the rewrite is great! I have one nit: did you consider which of these two idioms is better? if __name__ == "__main__": main() vs. if __name__ == "__main__": sys.exit(main()) Your docs seem to promote the second, whereas I've usually

[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! This comes right in time, because we're working on freezing many more modules, and modules containing frozen sets didn't have a consistent frozen representation. Now they do! (See issue45019, issue45020) -- nosy: +gvanrossum

[issue45041] [sqlite3] simplify executescript()

2021-08-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset e34bb409197d72711ae2c6197f9d8305533034d4 by Erlend Egeberg Aasland in branch 'main': bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)

[issue24139] Use sqlite3 extended error codes

2021-08-30 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26520 pull_request: https://github.com/python/cpython/pull/28076 ___ Python tracker ___

[issue36521] Consider removing docstrings from co_consts in code objects

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: I think we shouldn't change *which* code object contains the docstring (changing anything about that is likely to disturb someone's workflow in a way that's hard to fix) -- only how PyFunction_New finds that docstring in the code object (if that breaks

[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-30 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +26519 pull_request: https://github.com/python/cpython/pull/28075 ___ Python tracker ___

[issue45041] [sqlite3] simplify executescript()

2021-08-30 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26518 pull_request: https://github.com/python/cpython/pull/28074 ___ Python tracker ___

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW, I'd be okay with doing the -X flag in a separate PR. -- ___ Python tracker ___ ___

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: > At this point, here are the open questions I'm seeing: > + The editing-stdlib-.py-files problem: [...] > + Compatibility: [...] ? + Penalty for too many frozen modules: [...] > FWIW, I think the ideal mechanism for a dev build will be to opt in to

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

2021-08-30 Thread Jordan Borean
Change by Jordan Borean : -- pull_requests: +26517 pull_request: https://github.com/python/cpython/pull/28073 ___ Python tracker ___

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: [Gregory Szorc] > What do you set __file__ to? [...] Exactly. I think it should not be set, just like it's not set for builtin modules. > I have some observations about the implications of this. I typed up a long > comment but then realized someone

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Guido van Rossum
Guido van Rossum added the comment: > FWIW, I asked Ned Batchelder about this and he said this approach > ("fullcoverage" [1]) was added to support running coverage on the stdlib. > [...] The docs you pointed out in [3] (where it talks about a *horrible hack you should never use" :-)

[issue43124] [security] smtplib multiple CRLF injection

2021-08-30 Thread Ned Deily
Ned Deily added the comment: New changeset 29d97d17fb7adab3b0df9e178b73f70292d1cf64 by Miss Islington (bot) in branch '3.6': [3.6] bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) (GH-28038) https://github.com/python/cpython/commit/29d97d17fb7adab3b0df9e178b73f70292d1cf64

[issue16379] SQLite error code not exposed to python

2021-08-30 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Thanks, Torsten for this nice suggestion, Daniel & Aviv for the initial patches, Gerhard & Ezio for helping improving the API, and Pablo, Asif, Hai Shi, & Michael for reviewing and merging! -- resolution: -> fixed stage: patch review -> resolved

[issue43124] [security] smtplib multiple CRLF injection

2021-08-30 Thread Ned Deily
Ned Deily added the comment: New changeset d2cc04cd3024869101e894f73307944d98d187c8 by Miss Islington (bot) in branch '3.7': [3.7] bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) (GH-28037) https://github.com/python/cpython/commit/d2cc04cd3024869101e894f73307944d98d187c8

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Gregory Szorc
Gregory Szorc added the comment: > For stdlib modules it wouldn't be a big problem to set __file__ on > frozen modules. > Would that be enough to solve the problem? What do you set __file__ to? Do you still materialize the .py[c] files on disk and set to that? (This would make the most

[issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows

2021-08-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It may be a bug in the constructor of SharedMemory. It ignores the size argument on Windows. -- components: +Library (Lib), Windows nosy: +davin, paul.moore, pitrou, serhiy.storchaka, steve.dower, tim.golden, zach.ware

[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-30 Thread Ned Deily
Ned Deily added the comment: Thanks for the PR! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-30 Thread Ned Deily
Ned Deily added the comment: New changeset da9d6c554697414b1d275c8502e00a07c2ce06e6 by Miss Islington (bot) in branch '3.6': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27976)

[issue45053] MD5SumTests.test_checksum_fodder fails on Windows

2021-08-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Test is failing because TESTFN contains now non-ASCII characters. The path is written to stdout using the default stdout encoding on Windows (like cp1252), but test searches the path encoded with UTF-8. This test should fail also on other platforms with

[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-30 Thread Ned Deily
Ned Deily added the comment: New changeset e9b85afd7dc004460f6d914375ab67d617a8a7ff by Miss Islington (bot) in branch '3.7': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27975)

[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-30 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Is something missing here? No; all good. Thanks! -- ___ Python tracker ___ ___

[issue16379] SQLite error code not exposed to python

2021-08-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 86d8b465231473f850cc5e906013ba8581ddb503 by Erlend Egeberg Aasland in branch 'main': bpo-16379: expose SQLite error codes and error names in `sqlite3` (GH-27786)

[issue34561] Replace list sorting merge_collapse()?

2021-08-30 Thread Tim Peters
Tim Peters added the comment: New runstack.py mostly adds comments about a surprise: the idea that length-adaptive ShiversSort eeks out better results than powersort appears nearly unique to the specific "0.80" cutoff used in the random-case generation code to pick between two uniform

[issue14088] sys.executable generating canonical path

2021-08-30 Thread Ned Deily
Ned Deily added the comment: > I'm not against making Python even better: attempt to normalize the path ;-) I would be very cautious about doing that. I'm pretty sure it would break some existing code. -- nosy: +ned.deily ___ Python tracker

[issue45042] Many multiprocessing tests are silently skipped since 3.9

2021-08-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: Two new issues created: 1. https://bugs.python.org/issue45053 2. https://bugs.python.org/issue45052 -- ___ Python tracker ___

[issue45053] MD5SumTests.test_checksum_fodder fails on Windows

2021-08-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: I would love to work on this issue :) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue45053] MD5SumTests.test_checksum_fodder fails on Windows

2021-08-30 Thread Nikita Sobolev
New submission from Nikita Sobolev : While working on https://github.com/python/cpython/pull/28060 we've noticed that `test.test_tools.test_md5sum.MD5SumTests.test_checksum_fodder` fails on Windows: ``` == FAIL:

[issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows

2021-08-30 Thread Nikita Sobolev
Nikita Sobolev added the comment: I would like to work on this issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows

2021-08-30 Thread Nikita Sobolev
New submission from Nikita Sobolev : While working on https://github.com/python/cpython/pull/28060 we've noticed that `test.test_multiprocessing_spawn.WithProcessesTestSharedMemory.test_shared_memory_basics` fails on Windows: ```

[issue44895] refleak test failure in test_exceptions

2021-08-30 Thread Irit Katriel
Irit Katriel added the comment: I think the leak happens when we invoke GC while the recursion limit is exceeded. It goes way if make this change: def recurse_in_body_and_except(): try: recurse_in_body_and_except() except RecursionError as e:

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks for the fix, Serhiy, and Ryan for reporting the problem! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Is something missing here? -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset f62763d26755260c31c717fb396550e00eb6b2a0 by Erlend Egeberg Aasland in branch 'main': bpo-43398: Add test for defect connection factories (GH-27966) https://github.com/python/cpython/commit/f62763d26755260c31c717fb396550e00eb6b2a0

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread miss-islington
miss-islington added the comment: New changeset d65fad04fad1a73b6bb17bcb08ca6f0a24376952 by Miss Islington (bot) in branch '3.10': bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) https://github.com/python/cpython/commit/d65fad04fad1a73b6bb17bcb08ca6f0a24376952

[issue44019] operator.call/operator.__call__

2021-08-30 Thread Antony Lee
Antony Lee added the comment: > I'm not convinced that operator.caller() would be useful to me. To be clear, as noted above, I have realized that the semantics I initially proposed (now known as "caller") are not particularly useful; the semantics I am proposing (and implementing in the

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Eric Snow
Eric Snow added the comment: > * tricks to inject hooks ASAP (e.g. coverage.py swaps the encodings module) > may lose their entry point FWIW, I asked Ned Batchelder about this and he said this approach ("fullcoverage" [1]) was added to support running coverage on the stdlib. It doesn't

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Eric Snow
Eric Snow added the comment: At this point, here are the open questions I'm seeing: + The editing-stdlib-.py-files problem: * use a command-line flag to opt-out of frozen modules? * use a build flag to opt out (e.g. a configure flag or a new Py_NO_FROZEN or even Py_DEBUG)? * ignore

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 9827710a400848c9430ed364ed5d2d54f0926701 by Serhiy Storchaka in branch '3.9': [3.9] bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) (GH-28071)

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Eric Snow
Eric Snow added the comment: On Fri, Aug 27, 2021 at 11:14 PM Larry Hastings wrote: > [snip] On the other hand: if we made a viable tool that could consume some > arbitrary > set of .py files and produce a C file, and said C file could then be compiled > into a > shared library, end users

[issue45051] wrote optimised async_test.py for async lib

2021-08-30 Thread Zachary Ware
New submission from Zachary Ware : Ayush, your PRs are starting to look like spam. Please slow down and ask for advice on what contributions would be welcome. We have several resources available for this, such as the core-mentors...@python.org mailing list, the discuss.python.org

[issue45051] wrote optimised async_test.py for async lib

2021-08-30 Thread Ayush Parikh
Change by Ayush Parikh : -- nosy: Ayushparikh-code priority: normal pull_requests: 26516 severity: normal status: open title: wrote optimised async_test.py for async lib type: enhancement ___ Python tracker

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread Gregory Szorc
Gregory Szorc added the comment: My use case for these low-level APIs is to write tests for low-level string/encoding handling in my custom use of the PyPreConfig and PyConfig structs. I wanted to verify that exact byte sequences were turned into specific representations inside of Python

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26515 pull_request: https://github.com/python/cpython/pull/28071 ___ Python tracker ___

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +26514 pull_request: https://github.com/python/cpython/pull/28070 ___ Python tracker

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 08d9e597c8ef5a2b26375ac954fdf224f5d82c3c by Serhiy Storchaka in branch 'main': bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) https://github.com/python/cpython/commit/08d9e597c8ef5a2b26375ac954fdf224f5d82c3c

[issue45050] created unittest file analyze_text.py

2021-08-30 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : It is unneeded. -- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___

[issue45050] created unittest file analyze_text.py

2021-08-30 Thread Ayush Parikh
Change by Ayush Parikh : -- nosy: Ayushparikh-code priority: normal pull_requests: 26513 severity: normal status: open title: created unittest file analyze_text.py type: enhancement ___ Python tracker

[issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: Is it related to https://bugs.python.org/issue41034 ? -- nosy: +vstinner ___ Python tracker ___

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Dong-hee Na
Dong-hee Na added the comment: > https://github.com/brandtbucher/patmaperformance Nice benchmark suite, I will take a look :) -- ___ Python tracker ___

[issue45020] Freeze all modules imported during startup.

2021-08-30 Thread Eric Snow
Eric Snow added the comment: On Fri, Aug 27, 2021 at 6:29 PM Guido van Rossum wrote: > The plot thickens. By searching my extensive GMail archives for Jeethu Rao I > found > an email from Sept. 14 to python-dev by Larry Hastings titled "Store startup > modules > as C structures for 20%+

[issue44019] operator.call/operator.__call__

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > An actual use case I had for such an operator was collecting a bunch of > callables in a list and wanting to dispatch them to > concurrent.futures.Executor.map, i.e. something like > `executor.map(operator.call, funcs)` (to get the parallelized version of

[issue44019] operator.call/operator.__call__

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: Python 2.7 had apply(func, args, kwargs) which called func(*args, **kwargs). https://docs.python.org/2.7/library/functions.html#apply There is also functools.partial(func, *args, **kwargs)(*args2, **kwargs2) which calls func(*args, *args2, **kwargs,

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Brandt Bucher
Brandt Bucher added the comment: I'm also in the process of creating some pattern matching benchmarks. You might find them useful for benching optimizations like this in the future: https://github.com/brandtbucher/patmaperformance In particular, I'm curious to see the impact of this change

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Brandt Bucher
Brandt Bucher added the comment: Thanks, this is awesome. FYI, there's probably more low-hanging fruit like this scattered about the pattern matching implementation. It's all very new code, mostly written by one person ;). (I wouldn't worry too much about the pattern compiler, though...

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > PyUnicode_KIND does *not* expose the implementation details to the programmer. PyUnicode_KIND() is very specific to the exact PEP 393 implementation. Documentation of this field: --- /* Character size: - PyUnicode_WCHAR_KIND (0): * character type

[issue25867] os.stat raises exception when using unicode and no locale is set

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > It's doing this now, so seems like it has been fixed: % env -i ./python.exe > (...) Right. It's correct to close the issue. The PEP 540 added a UTF-8 Mode. This mode is enabled if Python is started with the "C" or "POSIX" locale (LC_CTYPE category). If

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread Petr Viktorin
Petr Viktorin added the comment: PyUnicode_KIND does *not* expose the implementation details to the programmer. If the internal representation os strings is switched to use masks and shifts instead of bitfields, PyUnicode_KIND (and others) can be adapted to the new details without breaking

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > In order to avoid undefined behavior, Python's C API should avoid all use of > bit fields. See also the PEP 620. IMO more generally, the C API should not expose structures, but provide ways to access it through getter and setter functions. See bpo-40120

[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-30 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +26512 pull_request: https://github.com/python/cpython/pull/28068 ___ Python tracker ___

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > The macro PyUnicode_KIND is part of the documented public C API. IMO it was a mistake to expose it as part of the public C API. This is an implementation detail which should not be exposed. The C API should not expose *directly* how characters are stored

[issue14088] sys.executable generating canonical path

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > The path is not required to be normalized. I'm talking about the current implementation. I'm not against making Python even better: attempt to normalize the path ;-) -- ___ Python tracker

[issue14088] sys.executable generating canonical path

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: test_sys: def test_executable(self): # sys.executable should be absolute self.assertEqual(os.path.abspath(sys.executable), sys.executable) IMO the test is wrong. It must test: test.assertTrue(os.path.isabs(sys.executable)). The path is

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread Petr Viktorin
Petr Viktorin added the comment: The macro PyUnicode_KIND is part of the documented public C API. It accesses the bit field "state.kind" directly. -- ___ Python tracker ___

[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: For the very specific case of os.environ.clear(), the C function clearenv() could be used if available. While clearenv() is available in the glibc, it's not a POSIX function. -- ___ Python tracker

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: > At least the PyASCIIObject struct in Include/cpython/unicodeobject.h uses bit > fields. Various preprocessor macros like PyUnicode_IS_ASCII() and > PyUnicode_KIND() access this struct's bit field. What is your use case? Which functions do you need? You

[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: On my Fedora 34, running ./configure creates pyconfig.h with these values: $ grep -E '_POSIX_C_SOURCE|_XOPEN_SOURCE' -B1 pyconfig.h /* Define to activate features from IEEE Stds 1003.1-2008 */ #define _POSIX_C_SOURCE 200809L -- /* Define to the level of

[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: Attached set_unset_env.c program calls putenv("=hello world") and then unsetenv(""). On my Fedora 34 with glibc-2.33-20.fc34.x86_64, putenv() succeed, but unsetenv() fails. --- $ gcc set_unset_env.c -g -o set_unset_env && ./set_unset_env putenv("=hello

[issue45042] Many multiprocessing tests are silently skipped since 3.9

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: FYI, there seem to be two Windows-specific regressions since the tests were unintentionally disabled, namely test_shared_memory_basics and test_checksum_fodder. Following Serhiy's advice, I elect to have those tests skipped for now on Windows and fix them

[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2021-08-30 Thread Irit Katriel
Irit Katriel added the comment: I see, so intercepting the assignment is not enough. Reopening. -- resolution: out of date -> status: closed -> open ___ Python tracker ___

[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: By the way: --- The env command from GNU coreutils supports setting the environment variable with an empty name but not unsetting it. That's a bug. $ env '=wibble' env |grep wibble =wibble $ env '=wibble' env -u '' env env:

[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2021-08-30 Thread STINNER Victor
STINNER Victor added the comment: The following command still fails on the Python main branch on Linux: --- $ env -i =value ./python -c 'import pprint, os; pprint.pprint(os.environ); del os.environ[""]' environ({'': 'value', 'LC_CTYPE': 'C.UTF-8'}) Traceback (most recent call last): File

[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2021-08-30 Thread Irit Katriel
Change by Irit Katriel : -- stage: test needed -> resolved status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue45021] Race condition in thread.py

2021-08-30 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

  1   2   >