]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-86493: Fix possible leaks in some modules initialization (GH-106768)
Serhiy Storchaka [Tue, 18 Jul 2023 07:50:47 +0000 (10:50 +0300)] 
gh-86493: Fix possible leaks in some modules initialization (GH-106768)

Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.

2 years agobpo-42327: C API: Add PyModule_Add() function (GH-23443)
Serhiy Storchaka [Tue, 18 Jul 2023 06:42:05 +0000 (09:42 +0300)] 
bpo-42327: C API: Add PyModule_Add() function (GH-23443)

It is a fixed implementation of PyModule_AddObject() which consistently
steals reference both on success and on failure.

2 years agogh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal,...
Serhiy Storchaka [Tue, 18 Jul 2023 06:00:22 +0000 (09:00 +0300)] 
gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767)

2 years agogh-106719: Fix __annotations__ getter and setter in the type and module types (GH...
Serhiy Storchaka [Tue, 18 Jul 2023 05:56:58 +0000 (08:56 +0300)] 
gh-106719: Fix __annotations__ getter and setter in the type and module types (GH-106720)

No longer suppress arbitrary errors. Simplify the code.

2 years agogh-106843: fix memleak in _PyCompile_CleanDoc (#106846)
Inada Naoki [Tue, 18 Jul 2023 03:44:16 +0000 (12:44 +0900)] 
gh-106843: fix memleak in _PyCompile_CleanDoc (#106846)

2 years agoSmall fixes to code generator (#106845)
Guido van Rossum [Tue, 18 Jul 2023 01:30:41 +0000 (18:30 -0700)] 
Small fixes to code generator (#106845)

These repair nits I found in PR gh-106798 (issue gh-106797) and in PR gh-106716 (issue gh-106706).

2 years agogh-104683: Argument Clinic: Modernise parse_special_symbol() (#106837)
Erlend E. Aasland [Mon, 17 Jul 2023 22:37:11 +0000 (00:37 +0200)] 
gh-104683: Argument Clinic: Modernise parse_special_symbol() (#106837)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoAdd Erlend as CODEOWNER for Argument Clinic docs (#106840)
Erlend E. Aasland [Mon, 17 Jul 2023 22:10:03 +0000 (00:10 +0200)] 
Add Erlend as CODEOWNER for Argument Clinic docs (#106840)

2 years agogh-106368: Increase Argument Clinic test coverage for cpp.Monitor (#106833)
Erlend E. Aasland [Mon, 17 Jul 2023 20:55:10 +0000 (22:55 +0200)] 
gh-106368: Increase Argument Clinic test coverage for cpp.Monitor (#106833)

2 years agogh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (#106832)
Nikita Sobolev [Mon, 17 Jul 2023 19:55:40 +0000 (22:55 +0300)] 
gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (#106832)

2 years agogh-106603: Make uop struct a triple (opcode, oparg, operand) (#106794)
Guido van Rossum [Mon, 17 Jul 2023 19:12:33 +0000 (12:12 -0700)] 
gh-106603: Make uop struct a triple (opcode, oparg, operand) (#106794)

2 years agogh-61215: threadingmock: Improve test suite to avoid race conditions (#106822)
Mario Corchero [Mon, 17 Jul 2023 18:57:40 +0000 (20:57 +0200)] 
gh-61215: threadingmock: Improve test suite to avoid race conditions (#106822)

threadingmock: Improve test suite to avoid race conditions

Simplify tests and split them into multiple tests to prevent assertions
from triggering race conditions.
Additionally, we rely on calling the mocks without delay to validate the
functionality of matching calls.

2 years agogh-106581: Add 10 new opcodes by allowing `assert(kwnames == NULL)` (#106707)
Guido van Rossum [Mon, 17 Jul 2023 18:02:58 +0000 (11:02 -0700)] 
gh-106581: Add 10 new opcodes by allowing `assert(kwnames == NULL)` (#106707)

By turning `assert(kwnames == NULL)` into a macro that is not in the "forbidden" list, many instructions that formerly were skipped because they contained such an assert (but no other mention of `kwnames`) are now supported in Tier 2. This covers 10 instructions in total (all specializations of `CALL` that invoke some C code):
- `CALL_NO_KW_TYPE_1`
- `CALL_NO_KW_STR_1`
- `CALL_NO_KW_TUPLE_1`
- `CALL_NO_KW_BUILTIN_O`
- `CALL_NO_KW_BUILTIN_FAST`
- `CALL_NO_KW_LEN`
- `CALL_NO_KW_ISINSTANCE`
- `CALL_NO_KW_METHOD_DESCRIPTOR_O`
- `CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS`
- `CALL_NO_KW_METHOD_DESCRIPTOR_FAST`

2 years agogh-106529: Generate uops for POP_JUMP_IF_[NOT_]NONE (#106796)
Guido van Rossum [Mon, 17 Jul 2023 17:06:05 +0000 (10:06 -0700)] 
gh-106529: Generate uops for POP_JUMP_IF_[NOT_]NONE (#106796)

These aren't automatically translated because (ironically)
they are macros deferring to POP_JUMP_IF_{TRUE,FALSE},
which are not viable uops (being manually translated).

The hack is that we emit IS_NONE and then set opcode and
jump to the POP_JUMP_IF_{TRUE,FALSE} translation code.

2 years agogh-106687: _ssl: use uint64_t for SSL options (#106700)
Victor Stinner [Mon, 17 Jul 2023 15:55:30 +0000 (17:55 +0200)] 
gh-106687: _ssl: use uint64_t for SSL options (#106700)

SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html

Fix this compiler warning on Windows with MSC:

    conversion from 'uint64_t' to 'long', possible loss of data

2 years agogh-104050: Improve Argument Clinic type annotation coverage (#106810)
Erlend E. Aasland [Mon, 17 Jul 2023 11:47:08 +0000 (13:47 +0200)] 
gh-104050: Improve Argument Clinic type annotation coverage (#106810)

Add various missing annotations in the following classes:
- BlockPrinter
- CConverter
- CLanguage
- FormatCounterFormatter
- Language
- _TextAccumulator

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-106789: avoid importing pprint from sysconfig (#106790)
Irit Katriel [Mon, 17 Jul 2023 09:28:33 +0000 (10:28 +0100)] 
gh-106789: avoid importing pprint from sysconfig (#106790)

2 years agogh-106780: Add __match_args__ to tutorial example (#106784)
Terry Jan Reedy [Mon, 17 Jul 2023 03:36:03 +0000 (23:36 -0400)] 
gh-106780: Add __match_args__ to tutorial example (#106784)

Add Point definition with this attribute before example
that needs it.

2 years agoAdd more recipe tests. Make the factor recipe a bit faster and clearer. (GH-106817)
Raymond Hettinger [Mon, 17 Jul 2023 02:37:07 +0000 (21:37 -0500)] 
Add more recipe tests. Make the factor recipe a bit faster and clearer. (GH-106817)

2 years agogh-106797: Remove warning logs from Python/generated_cases.c.h (gh-106798)
Dong-hee Na [Mon, 17 Jul 2023 00:09:11 +0000 (09:09 +0900)] 
gh-106797: Remove warning logs from Python/generated_cases.c.h (gh-106798)

2 years agogh-104050: Argument Clinic: Annotate Clinic.parse() (#106760)
Erlend E. Aasland [Mon, 17 Jul 2023 00:04:10 +0000 (02:04 +0200)] 
gh-104050: Argument Clinic: Annotate Clinic.parse() (#106760)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-105540: Convert `pytest` tests of `cases_generator` to regular tests (#106713)
Nikita Sobolev [Sun, 16 Jul 2023 23:05:24 +0000 (02:05 +0300)] 
gh-105540: Convert `pytest` tests of `cases_generator` to regular tests (#106713)

2 years agoFix the french used in the email documentation (GH-106279)
Jean-Baptiste Poupon [Sun, 16 Jul 2023 17:14:08 +0000 (20:14 +0300)] 
Fix the french used in the email documentation (GH-106279)

* Fix the french used in the email documentation

The french used in one of the example was either machine translated a while ago or written by someone who does not speak french. Fixed it by using grammatically correct french.

2 years agogh-105726: Add `__slots__` to `AbstractContextManager` and `AbstractAsyncContextManag...
Grigoriev Semyon [Sun, 16 Jul 2023 15:30:39 +0000 (18:30 +0300)] 
gh-105726: Add `__slots__` to `AbstractContextManager` and `AbstractAsyncContextManager` (#106771)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agogh-106706: Streamline family syntax in cases generator DSL (#106716)
Kevin Diem [Sun, 16 Jul 2023 15:16:34 +0000 (11:16 -0400)] 
gh-106706: Streamline family syntax in cases generator DSL (#106716)

From `family(opname, STRUCTSIZE) = OPNAME + SPEC1 + ... +  SPECn;`
to `family(OPNAME, STRUCTSIZE) = SPEC1 + ... + SPECn;`

2 years agoDoc: fix section levels of devmode doc (#106801)
Inada Naoki [Sun, 16 Jul 2023 12:23:54 +0000 (21:23 +0900)] 
Doc: fix section levels of devmode doc (#106801)

2 years agoDoc: devmode: add -Xdev option to example (#106253)
Simone Rubino [Sun, 16 Jul 2023 07:29:58 +0000 (09:29 +0200)] 
Doc: devmode: add -Xdev option to example (#106253)

2 years agoDocs search: Replace jQuery with vanilla JavaScript (#106743)
Hugo van Kemenade [Sun, 16 Jul 2023 07:26:26 +0000 (10:26 +0300)] 
Docs search: Replace jQuery with vanilla JavaScript (#106743)

* Replace jQuery with vanilla JavaScript
* Switch 'var' to 'const' or 'let'

2 years agoDocs: Normalize Argument Clinic How-To section capitalization (#106788)
Erlend E. Aasland [Sat, 15 Jul 2023 22:42:58 +0000 (00:42 +0200)] 
Docs: Normalize Argument Clinic How-To section capitalization (#106788)

2 years agofaq/library: remove outdated section (#105996)
Mathieu Dupuy [Sat, 15 Jul 2023 20:23:10 +0000 (22:23 +0200)] 
faq/library: remove outdated section (#105996)

2 years agoAdd more examples to the recipe docs (GH-106782)
Raymond Hettinger [Sat, 15 Jul 2023 19:43:09 +0000 (14:43 -0500)] 
Add more examples to the recipe docs (GH-106782)

Demonstrate that factor() works for large composites and large primes.

2 years agogh-106752: Sync with zipp 3.16.2 (#106757)
Jason R. Coombs [Sat, 15 Jul 2023 13:21:17 +0000 (09:21 -0400)] 
gh-106752: Sync with zipp 3.16.2 (#106757)

* gh-106752: Sync with zipp 3.16.2

* Add blurb

2 years agogh-81283: compiler: remove indent from docstring (#106411)
Inada Naoki [Sat, 15 Jul 2023 10:33:32 +0000 (19:33 +0900)] 
gh-81283: compiler: remove indent from docstring (#106411)

Co-authored-by: Éric <merwok@netwok.org>
2 years agogh-104050: Argument Clinic: Annotate BlockParser (#106750)
Erlend E. Aasland [Sat, 15 Jul 2023 10:11:32 +0000 (12:11 +0200)] 
gh-104050: Argument Clinic: Annotate BlockParser (#106750)

2 years agogh-106368: Increase Argument Clinic BlockParser test coverage (#106759)
Erlend E. Aasland [Sat, 15 Jul 2023 09:28:57 +0000 (11:28 +0200)] 
gh-106368: Increase Argument Clinic BlockParser test coverage (#106759)

2 years agogh-106529: Fix subtle Tier 2 edge case with list iterator (#106756)
Guido van Rossum [Sat, 15 Jul 2023 00:22:06 +0000 (17:22 -0700)] 
gh-106529: Fix subtle Tier 2 edge case with list iterator (#106756)

The Tier 2 opcode _IS_ITER_EXHAUSTED_LIST (and _TUPLE)
didn't set it->it_seq to NULL, causing a subtle bug
that resulted in test_exhausted_iterator in list_tests.py
to fail when running all tests with -Xuops.

The bug was introduced in gh-106696.

Added this as an explicit test.

Also fixed the dependencies for ceval.o -- it depends on executor_cases.c.h.

2 years agogh-106752: Move zipfile._path into its own package (#106753)
Jason R. Coombs [Fri, 14 Jul 2023 20:40:46 +0000 (16:40 -0400)] 
gh-106752: Move zipfile._path into its own package (#106753)

* gh-106752: Move zipfile._path into its own package so it may have supplementary behavior.

* Add blurb

2 years agogh-102799: replace internal sys.exc_info() call by sys.exception() (#106746)
Irit Katriel [Fri, 14 Jul 2023 19:41:24 +0000 (20:41 +0100)] 
gh-102799: replace internal sys.exc_info() call by sys.exception() (#106746)

2 years agogh-106745: typing docs: Clarify that removal of PEP-585 aliases is not currently...
Alex Waygood [Fri, 14 Jul 2023 18:49:02 +0000 (19:49 +0100)] 
gh-106745: typing docs: Clarify that removal of PEP-585 aliases is not currently planned (#106748)

2 years agogh-106554: replace `_BaseSelectorImpl._key_from_fd` with `dict.get` (#106555)
J. Nick Koston [Fri, 14 Jul 2023 18:46:30 +0000 (08:46 -1000)] 
gh-106554: replace `_BaseSelectorImpl._key_from_fd` with `dict.get` (#106555)

2 years agogh-105481: expose opcode metadata via the _opcode module (#106688)
Irit Katriel [Fri, 14 Jul 2023 17:41:52 +0000 (18:41 +0100)] 
gh-105481: expose opcode metadata via the _opcode module (#106688)

2 years agogh-106531: Remove importlib.resources._legacy (#106532)
Jason R. Coombs [Fri, 14 Jul 2023 17:38:28 +0000 (13:38 -0400)] 
gh-106531: Remove importlib.resources._legacy (#106532)

* gh-106531: Remove importlib.resources._legacy

Syncs with importlib_resources 6.0.

* Remove documentation for removed functionality.

2 years agogh-104050: Argument Clinic: Annotate `output_templates()` (#106732)
Erlend E. Aasland [Fri, 14 Jul 2023 12:20:58 +0000 (14:20 +0200)] 
gh-104050: Argument Clinic: Annotate `output_templates()` (#106732)

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2 years agogh-106446: Fix failed doctest in stdtypes (#106447)
Charlie Zhao [Fri, 14 Jul 2023 07:38:03 +0000 (15:38 +0800)] 
gh-106446: Fix failed doctest in stdtypes (#106447)

---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-105293: Do not call SSL_CTX_set_session_id_context on client side SSL context...
Grant Ramsay [Fri, 14 Jul 2023 07:10:54 +0000 (19:10 +1200)] 
gh-105293: Do not call SSL_CTX_set_session_id_context on client side SSL context (#105295)

* gh-105293: Do not call SSL_CTX_set_session_id_context on client side SSL context

Openssl states this is a "server side only" operation.
Calling this on a client side socket can result in unexpected behavior

* Add news entry on SSL "set session id context" changes

2 years agogh-105626: Change the default return value of `HTTPConnection.get_proxy_response_head...
Nikita Sobolev [Fri, 14 Jul 2023 06:55:49 +0000 (09:55 +0300)] 
gh-105626: Change the default return value of `HTTPConnection.get_proxy_response_headers` (#105628)

2 years agogh-106529: Split FOR_ITER_{LIST,TUPLE} into uops (#106696)
Guido van Rossum [Fri, 14 Jul 2023 00:27:35 +0000 (17:27 -0700)] 
gh-106529: Split FOR_ITER_{LIST,TUPLE} into uops (#106696)

Also rename `_ITER_EXHAUSTED_XXX` to `_IS_ITER_EXHAUSTED_XXX` to make it clear this is a test.

2 years agogh-104683: Argument clinic: use an enum to describe the different kinds of functions...
Alex Waygood [Thu, 13 Jul 2023 22:54:05 +0000 (23:54 +0100)] 
gh-104683: Argument clinic: use an enum to describe the different kinds of functions (#106721)

Argument clinic: use an enum to describe the different kinds of functions

2 years agogh-106368: Increase Argument Clinic test coverage (#106728)
Erlend E. Aasland [Thu, 13 Jul 2023 22:18:32 +0000 (00:18 +0200)] 
gh-106368: Increase Argument Clinic test coverage (#106728)

- improve output_parameter() coverage
- improve coverage for Function.kind

2 years agodocs: clarify Path.suffix (GH-106650)
Ned Batchelder [Thu, 13 Jul 2023 19:24:54 +0000 (12:24 -0700)] 
docs: clarify Path.suffix (GH-106650)

2 years agogh-106664: selectors: add get() method to _SelectorMapping (#106665)
J. Nick Koston [Thu, 13 Jul 2023 19:18:53 +0000 (09:18 -1000)] 
gh-106664: selectors: add get() method to _SelectorMapping (#106665)

It can be used to avoid raising and catching KeyError twice via __getitem__.

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2 years agogh-106701: Move the hand-written Tier 2 uops to bytecodes.c (#106702)
Guido van Rossum [Thu, 13 Jul 2023 19:14:51 +0000 (12:14 -0700)] 
gh-106701: Move the hand-written Tier 2 uops to bytecodes.c (#106702)

This moves EXIT_TRACE, SAVE_IP, JUMP_TO_TOP, and
_POP_JUMP_IF_{FALSE,TRUE} from ceval.c to bytecodes.c.

They are no less special than before, but this way
they are discoverable o the copy-and-patch tooling.

2 years agogh-106690: Add a .coveragerc file to the CPython repository (#8150)
Ammar Askar [Thu, 13 Jul 2023 15:45:21 +0000 (11:45 -0400)] 
gh-106690: Add a .coveragerc file to the CPython repository (#8150)

The added file is the coverage default at some point in time + checking branches both ways + IDLE additions, labelled as such and somewhat designed to be unlikely to affect other files.  Located in the CPython repository directory, it can be used where it is or copied elsewhere, depending on how one runs coverage.
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agoGH-104909: Split `LOAD_ATTR_INSTANCE_VALUE` into micro-ops (GH-106678)
Mark Shannon [Thu, 13 Jul 2023 15:36:19 +0000 (16:36 +0100)] 
GH-104909: Split `LOAD_ATTR_INSTANCE_VALUE` into micro-ops (GH-106678)

2 years agogh-106309: Deprecate typing.no_type_check_decorator (#106312)
Alex Waygood [Thu, 13 Jul 2023 13:30:35 +0000 (14:30 +0100)] 
gh-106309: Deprecate typing.no_type_check_decorator (#106312)

2 years agogh-106634: Corrected minor asyncio doc issues (#106671)
Chris Brett [Thu, 13 Jul 2023 07:51:13 +0000 (08:51 +0100)] 
gh-106634: Corrected minor asyncio doc issues (#106671)

2 years agogh-106628: email parsing speedup (gh-106629)
CF Bolz-Tereick [Thu, 13 Jul 2023 06:12:56 +0000 (08:12 +0200)] 
gh-106628: email parsing speedup (gh-106629)

2 years agogh-89427: Set VIRTUAL_ENV_PROMPT even when VIRTUAL_ENV_DISABLE_PROMPT… (GH-106643)
Jim Porter [Thu, 13 Jul 2023 06:08:33 +0000 (23:08 -0700)] 
gh-89427: Set VIRTUAL_ENV_PROMPT even when VIRTUAL_ENV_DISABLE_PROMPT… (GH-106643)

2 years agogh-105235: Prevent reading outside buffer during mmap.find() (#105252)
Dennis Sweeney [Thu, 13 Jul 2023 02:50:45 +0000 (22:50 -0400)] 
gh-105235: Prevent reading outside buffer during mmap.find() (#105252)

* Add a special case for s[-m:] == p in _PyBytes_Find

* Add tests for _PyBytes_Find

* Make sure that start <= end in mmap.find

2 years agogh-104050: Argument Clinic: Annotate nested function parser_body() in the CLanguage...
Erlend E. Aasland [Wed, 12 Jul 2023 22:49:30 +0000 (00:49 +0200)] 
gh-104050: Argument Clinic: Annotate nested function parser_body() in the CLanguage class (#106699)

2 years agogh-104683: Argument clinic: modernise `cpp.Monitor` (#106698)
Alex Waygood [Wed, 12 Jul 2023 22:48:36 +0000 (23:48 +0100)] 
gh-104683: Argument clinic: modernise `cpp.Monitor` (#106698)

2 years agogh-104050: Argument clinic: Annotate the `Destination` class (#106655)
Alex Waygood [Wed, 12 Jul 2023 21:33:47 +0000 (22:33 +0100)] 
gh-104050: Argument clinic: Annotate the `Destination` class (#106655)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years agogh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106666)
Prince Roshan [Wed, 12 Jul 2023 21:01:17 +0000 (02:31 +0530)] 
gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106666)

2 years agogh-106236: Replace `assert` with `raise RuntimeError` in `threading.py` (#106237)
Nikita Sobolev [Wed, 12 Jul 2023 18:07:59 +0000 (21:07 +0300)] 
gh-106236: Replace `assert` with `raise RuntimeError` in `threading.py` (#106237)

Replace `assert` with `raise ` in `threading.py` so that -OO does not alter _DummyThread behavior.

2 years agogh-106529: Split FOR_ITER_RANGE into uops (#106638)
Guido van Rossum [Wed, 12 Jul 2023 17:23:59 +0000 (10:23 -0700)] 
gh-106529: Split FOR_ITER_RANGE into uops (#106638)

For an example of what this does for Tier 1 and Tier 2, see
https://github.com/python/cpython/issues/106529#issuecomment-1631649920

2 years agogh-106656: Remove --emit-line-directives from regen-cases (#106657)
Guido van Rossum [Wed, 12 Jul 2023 16:12:39 +0000 (09:12 -0700)] 
gh-106656: Remove --emit-line-directives from regen-cases (#106657)

If you prefer to see `#line` directives in generated_cases.c.h, run
```
make regen-cases CASESFLAG=-l
```
But please don't commit the result.

2 years agoGH-104909: Break LOAD_GLOBAL specializations in micro-ops. (GH-106677)
Mark Shannon [Wed, 12 Jul 2023 13:34:14 +0000 (14:34 +0100)] 
GH-104909: Break LOAD_GLOBAL specializations in micro-ops. (GH-106677)

2 years agogh-99079: Update Windows build to use OpenSSL 3.0.9 (GH-106649)
Steve Dower [Wed, 12 Jul 2023 12:46:30 +0000 (13:46 +0100)] 
gh-99079: Update Windows build to use OpenSSL 3.0.9 (GH-106649)

2 years agogh-105481: move Python/opcode_metadata.h to Include/internal/pycore_opcode_metadata...
Irit Katriel [Wed, 12 Jul 2023 10:30:25 +0000 (11:30 +0100)] 
gh-105481: move Python/opcode_metadata.h to Include/internal/pycore_opcode_metadata.h (#106673)

2 years agogh-105373: Elaborate Pending Removal in What's New in Python 3.13 (#106675)
Victor Stinner [Wed, 12 Jul 2023 10:28:10 +0000 (12:28 +0200)] 
gh-105373: Elaborate Pending Removal in What's New in Python 3.13 (#106675)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-106521: Remove _PyObject_LookupAttr() function (GH-106642)
Serhiy Storchaka [Wed, 12 Jul 2023 05:57:10 +0000 (08:57 +0300)] 
gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)

2 years agoAdd Plausible for docs metrics (#106644)
Hugo van Kemenade [Wed, 12 Jul 2023 02:35:24 +0000 (05:35 +0300)] 
Add Plausible for docs metrics (#106644)

2 years agogh-104683: Argument clinic: Minor readability improvements for `Destination.__init__...
Alex Waygood [Tue, 11 Jul 2023 23:08:28 +0000 (00:08 +0100)] 
gh-104683: Argument clinic: Minor readability improvements for `Destination.__init__` (#106652)

2 years agogh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory...
Ijtaba Hussain [Tue, 11 Jul 2023 22:22:18 +0000 (23:22 +0100)] 
gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (#103213)

Fetch CONFIG_ARGS from the original source directory, instead of from
the copied source tree. When "make clean" is executed in the copied
source tree, the build directory is cleared and the configure argument
lookup fails. However, the original source directory still contains this
information.

2 years agogh-106529: Implement JUMP_FORWARD in uops (with test) (#106651)
Guido van Rossum [Tue, 11 Jul 2023 22:13:57 +0000 (15:13 -0700)] 
gh-106529: Implement JUMP_FORWARD in uops (with test) (#106651)

Note that this may generate two SAVE_IP uops in a row.
Removing unneeded SAVE_IP uops is the optimizer's job.

2 years agogh-104050: Argument Clinic: Annotate the `Block` class (#106519)
Alex Waygood [Tue, 11 Jul 2023 21:21:14 +0000 (22:21 +0100)] 
gh-104050: Argument Clinic: Annotate the `Block` class (#106519)

2 years agogh-104584: readability improvements in optimizer.c (#106641)
Irit Katriel [Tue, 11 Jul 2023 20:25:41 +0000 (23:25 +0300)] 
gh-104584: readability improvements in optimizer.c (#106641)

2 years agogh-96165: Clarify passing ":memory:" in sqlite3.connect() (#106451)
Mariusz Felisiak [Tue, 11 Jul 2023 20:18:19 +0000 (22:18 +0200)] 
gh-96165: Clarify passing ":memory:" in sqlite3.connect() (#106451)

2 years agogh-96165: Clarify omitting the FROM clause in SQLite queries (#106513)
Mariusz Felisiak [Tue, 11 Jul 2023 20:09:04 +0000 (22:09 +0200)] 
gh-96165: Clarify omitting the FROM clause in SQLite queries (#106513)

2 years agogh-106307: C API: Add PyMapping_GetOptionalItem() function (GH-106308)
Serhiy Storchaka [Tue, 11 Jul 2023 20:04:12 +0000 (23:04 +0300)] 
gh-106307: C API: Add PyMapping_GetOptionalItem() function (GH-106308)

Also add PyMapping_GetOptionalItemString() function.

2 years agogh-106597: Add debugging struct with offsets for out-of-process tools (#106598)
Pablo Galindo Salgado [Tue, 11 Jul 2023 19:35:41 +0000 (20:35 +0100)] 
gh-106597: Add debugging struct with offsets for out-of-process tools (#106598)

2 years agogh-106521: Add PyObject_GetOptionalAttr() function (GH-106522)
Serhiy Storchaka [Tue, 11 Jul 2023 19:13:27 +0000 (22:13 +0300)] 
gh-106521: Add PyObject_GetOptionalAttr() function (GH-106522)

It is a new name of former _PyObject_LookupAttr().

Add also PyObject_GetOptionalAttrString().

2 years agogh-106529: Support JUMP_BACKWARD in Tier 2 (uops) (#106543)
Guido van Rossum [Tue, 11 Jul 2023 18:08:10 +0000 (11:08 -0700)] 
gh-106529: Support JUMP_BACKWARD in Tier 2 (uops) (#106543)

During superblock generation, a JUMP_BACKWARD instruction is translated to either a JUMP_TO_TOP micro-op (when the target of the jump is exactly the beginning of the superblock, closing the loop), or a SAVE_IP + EXIT_TRACE pair, when the jump goes elsewhere.

The new JUMP_TO_TOP instruction includes a CHECK_EVAL_BREAKER() call, so a closed loop can still be interrupted.

2 years agogh-102541: Add test case for help() for non_existent_module (#106340)
Kirill Podoprigora [Tue, 11 Jul 2023 18:04:09 +0000 (21:04 +0300)] 
gh-102541: Add test case for help() for non_existent_module (#106340)

Test fix for when one enters, for instance, 'abd' at the 'help>' prompt.
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-106625 : Add missing code to tutorial 4.6 example (#106623)
RustyNail [Tue, 11 Jul 2023 17:22:07 +0000 (02:22 +0900)] 
gh-106625 : Add missing code to tutorial 4.6 example (#106623)

* Added missing import statement.

* Update Doc/tutorial/controlflow.rst

* Update Doc/tutorial/controlflow.rst

* Update controlflow.rst

* Make point regular class with __init__.

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-106403: Restore weakref support for TypeVar and friends (#106418)
Jelle Zijlstra [Tue, 11 Jul 2023 15:43:24 +0000 (08:43 -0700)] 
gh-106403: Restore weakref support for TypeVar and friends (#106418)

2 years agogh-106498: Revert incorrect colorsys.rgb_to_hls change (#106627)
Terry Jan Reedy [Tue, 11 Jul 2023 15:07:20 +0000 (11:07 -0400)] 
gh-106498: Revert incorrect colorsys.rgb_to_hls change (#106627)

gh-86618 assumed a-b-c = a-(b+c) = a-d where d = b+d.
For floats 2.0, 1.0, and 0.9999999999999999, this assumption
is false.  The net change of 1.1102230246251565e-16 to 0.0
results in division by 0.  Revert the replacement.  Add test.

2 years agowasm: do not use inline comment in .editorconfig (#106610)
Eisuke Kawashima [Tue, 11 Jul 2023 14:55:37 +0000 (23:55 +0900)] 
wasm: do not use inline comment in .editorconfig (#106610)

It is no longer valid since 0.15.0
https://github.com/editorconfig/specification/blob/v0.15/index.rst#no-inline-comments

2 years agogh-106360: remove redundant #ifdef (#106622)
Irit Katriel [Tue, 11 Jul 2023 12:41:50 +0000 (15:41 +0300)] 
gh-106360: remove redundant #ifdef (#106622)

2 years agogh-105497: [Enum] Fix flag mask inversion when unnamed flags exist (#106468)
Ethan Furman [Tue, 11 Jul 2023 11:35:54 +0000 (04:35 -0700)] 
gh-105497: [Enum] Fix flag mask inversion when unnamed flags exist (#106468)

For example:

    class Flag(enum.Flag):
        A = 0x01
        B = 0x02
        MASK = 0xff

    ~Flag.MASK is Flag(0)

2 years agogh-103968: What's New: Add porting hints for PyType_From with metaclasses (GH-105698)
Petr Viktorin [Tue, 11 Jul 2023 11:20:29 +0000 (13:20 +0200)] 
gh-103968: What's New: Add porting hints for PyType_From with metaclasses (GH-105698)

2 years agogh-106078: Move external C-API functions to decimal module global state (#106616)
Charlie Zhao [Tue, 11 Jul 2023 11:06:42 +0000 (19:06 +0800)] 
gh-106078: Move external C-API functions to decimal module global state (#106616)

2 years agoGH-106529: Define POP_JUMP_IF_NONE in terms of POP_JUMP_IF_TRUE (GH-106599)
Mark Shannon [Tue, 11 Jul 2023 10:33:59 +0000 (11:33 +0100)] 
GH-106529: Define POP_JUMP_IF_NONE in terms of POP_JUMP_IF_TRUE (GH-106599)

2 years agogh-106572: Convert PyObject_DelAttr() to a function (#106611)
Victor Stinner [Tue, 11 Jul 2023 09:38:22 +0000 (11:38 +0200)] 
gh-106572: Convert PyObject_DelAttr() to a function (#106611)

* Convert PyObject_DelAttr() and PyObject_DelAttrString() macros to
  functions.
* Add PyObject_DelAttr() and PyObject_DelAttrString() functions to
  the stable ABI.
* Replace PyObject_SetAttr(obj, name, NULL) with
  PyObject_DelAttr(obj, name).

2 years agoRemove unused branches from mock module (#106617)
Chris Withers [Tue, 11 Jul 2023 08:52:12 +0000 (09:52 +0100)] 
Remove unused branches from mock module (#106617)

* lambda has a name of __none__, but no async lambda so this branch is not needed

* _get_signature_object only returns None for bound builtins. There are no async builtins so this branch isn't needed

* Exclude  a couple of methods from coverage checking in the downstream rolling backport of mock

2 years agogh-106529: Silence compiler warning in jump target patching (#106613)
Guido van Rossum [Tue, 11 Jul 2023 02:12:32 +0000 (19:12 -0700)] 
gh-106529: Silence compiler warning in jump target patching (#106613)

(gh-106551 caused a compiler warning about on Windows.)

2 years agogh-104635: Add a test case for variables that have a dependency. (gh-106583)
Dong-hee Na [Tue, 11 Jul 2023 01:14:53 +0000 (10:14 +0900)] 
gh-104635: Add a test case for variables that have a dependency. (gh-106583)

2 years agogh-106529: Implement POP_JUMP_IF_XXX uops (#106551)
Guido van Rossum [Mon, 10 Jul 2023 23:04:26 +0000 (16:04 -0700)] 
gh-106529: Implement POP_JUMP_IF_XXX uops (#106551)

- Hand-written uops JUMP_IF_{TRUE,FALSE}.
  These peek at the top of the stack.
  The jump target (in superblock space) is absolute.

- Hand-written translation for POP_JUMP_IF_{TRUE,FALSE},
  assuming the jump is unlikely.
  Once we implement jump-likelihood profiling,
  we can implement the jump-unlikely case (in another PR).

- Tests (including some test cleanup).

- Improvements to len(ex) and ex[i] to expose the whole trace.

2 years agogh-102988: Detect email address parsing errors and return empty tuple to indicate...
Thomas Dwyer [Mon, 10 Jul 2023 23:00:55 +0000 (18:00 -0500)] 
gh-102988: Detect email address parsing errors and return empty tuple to indicate the parsing error (old API) (#105127)

Detect email address parsing errors and return empty tuple to indicate the parsing error (old API). This fixes or at least ameliorates CVE-2023-27043.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-94777: Fix deadlock in ProcessPoolExecutor (#94784)
Louis Paulot [Mon, 10 Jul 2023 21:45:27 +0000 (23:45 +0200)] 
gh-94777: Fix deadlock in ProcessPoolExecutor (#94784)

Fixes a hang in multiprocessing process pool executor when a child process crashes and code could otherwise block on writing to the pipe.  See GH-94777 for more details.