]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 years agoGH-90690: Remove `PRECALL` instruction (GH-92925)
Mark Shannon [Thu, 19 May 2022 10:05:26 +0000 (11:05 +0100)] 
GH-90690: Remove `PRECALL` instruction (GH-92925)

3 years agoDoc: amend ssl.PROTOCOL_SSLv2 and ssl.PROTOCOL_SSLv3 wording (#92634)
Jan Brasna [Thu, 19 May 2022 09:22:16 +0000 (11:22 +0200)] 
Doc: amend ssl.PROTOCOL_SSLv2 and ssl.PROTOCOL_SSLv3 wording (#92634)

3 years agogh-92670: Skip test_shutil.TestCopy.test_copyfile_nonexistent_dir on AIX (#92718)
Ayappan Perumal [Thu, 19 May 2022 09:17:44 +0000 (14:47 +0530)] 
gh-92670: Skip test_shutil.TestCopy.test_copyfile_nonexistent_dir on AIX (#92718)

3 years agoInclude ``asyncio.Barrier`` in 3.11 Whats New (GH-92927)
Duprat [Thu, 19 May 2022 07:12:33 +0000 (09:12 +0200)] 
Include ``asyncio.Barrier`` in 3.11 Whats New (GH-92927)

3 years agogh-92914: Round the allocated size for lists up to the even number (GH-92915)
Serhiy Storchaka [Thu, 19 May 2022 05:43:50 +0000 (08:43 +0300)] 
gh-92914: Round the allocated size for lists up to the even number (GH-92915)

3 years agogh-87901: Remove the encoding argument from os.popen (GH-92836)
Inada Naoki [Thu, 19 May 2022 02:42:43 +0000 (11:42 +0900)] 
gh-87901: Remove the encoding argument from os.popen (GH-92836)

3 years agogh-92812: Align ArgumentParser.add_subparsers() docs with argument spec (#92814)
180909 [Wed, 18 May 2022 21:08:23 +0000 (05:08 +0800)] 
gh-92812: Align ArgumentParser.add_subparsers() docs with argument spec (#92814)

3 years agoSplit refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)
Mark Shannon [Wed, 18 May 2022 13:38:43 +0000 (14:38 +0100)] 
Split refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)

3 years agoRemove Windows release build script (GH-92908)
Steve Dower [Wed, 18 May 2022 13:26:36 +0000 (14:26 +0100)] 
Remove Windows release build script (GH-92908)

The scripts have been migrated to the release-tools repository

3 years agobpo-42047: Add native thread ID for DragonFlyBSD (#22714)
David CARLIER [Wed, 18 May 2022 13:10:10 +0000 (14:10 +0100)] 
bpo-42047: Add native thread ID for DragonFlyBSD (#22714)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 years agogh-91755: Remove doc of C API private refcount functions (#92918)
Victor Stinner [Wed, 18 May 2022 12:09:44 +0000 (14:09 +0200)] 
gh-91755: Remove doc of C API private refcount functions (#92918)

These functions should only be used by Python internals.

3 years agogh-92780: Improve sqlite3.Connection.create_collation docs (#92790)
Erlend Egeberg Aasland [Wed, 18 May 2022 11:44:16 +0000 (13:44 +0200)] 
gh-92780: Improve sqlite3.Connection.create_collation docs (#92790)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
3 years agogh-91755: Document Py_IncRef and Py_DecRef as C functions (#91805)
Charlie Zhao [Wed, 18 May 2022 08:42:05 +0000 (16:42 +0800)] 
gh-91755: Document Py_IncRef and Py_DecRef as C functions (#91805)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agobpo-40838: document `getdoc`, `getmodule`, `getsourcefile` in `inspect` returns ...
Nikita Sobolev [Wed, 18 May 2022 01:24:35 +0000 (04:24 +0300)] 
bpo-40838: document `getdoc`, `getmodule`, `getsourcefile` in `inspect` returns `None` (#30575)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 years agogh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)
Oleg Iarygin [Tue, 17 May 2022 22:27:32 +0000 (01:27 +0300)] 
gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)

3 years agobpo-38704: Prevent installation on unsupported Windows versions (GH-17950)
Zackery Spytz [Tue, 17 May 2022 22:24:17 +0000 (15:24 -0700)] 
bpo-38704: Prevent installation on unsupported Windows versions (GH-17950)

3 years agogh-89898: Fix test_threading.test_args_argument() (#92885)
Victor Stinner [Tue, 17 May 2022 22:19:56 +0000 (00:19 +0200)] 
gh-89898: Fix test_threading.test_args_argument() (#92885)

Join the thread to not leak threads running in the background to the
next test.

Fix the following warning on the "AMD64 FreeBSD Shared 3.11"
buildbot:

test_args_argument (test.test_threading.ThreadTests.test_args_argument) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)
Warning -- Dangling thread: <_MainThread(MainThread, started 35026161664)>
Warning -- Dangling thread: <Thread(Thread-134 (<lambda>), started 35314998016)>
ok

3 years agogh-89653: Add assertions on PyUnicode_READ() index (#92883)
Victor Stinner [Tue, 17 May 2022 17:43:19 +0000 (19:43 +0200)] 
gh-89653: Add assertions on PyUnicode_READ() index (#92883)

Add assertions on the index argument of PyUnicode_READ(),
PyUnicode_READ_CHAR() and PyUnicode_WRITE() functions.

3 years agogh-89653: PEP 670: Fix PyUnicode_READ() cast (#92872)
Victor Stinner [Tue, 17 May 2022 17:20:37 +0000 (19:20 +0200)] 
gh-89653: PEP 670: Fix PyUnicode_READ() cast (#92872)

_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST()
instead.

3 years agoFix NULL check in test_type_from_ephemeral_spec in_testcapimodule.c (GH-92863)
Dennis Sweeney [Tue, 17 May 2022 15:17:16 +0000 (11:17 -0400)] 
Fix NULL check in test_type_from_ephemeral_spec in_testcapimodule.c (GH-92863)

3 years agogh-92536: Update unicode struct size to ensure MemoryError is raised (GH-92867)
Dennis Sweeney [Tue, 17 May 2022 14:12:21 +0000 (10:12 -0400)] 
gh-92536: Update unicode struct size to ensure MemoryError is raised (GH-92867)

3 years agogh-92782: unify the style of CFG traversal algorithms in the compiler (GH-92784)
Irit Katriel [Tue, 17 May 2022 12:00:11 +0000 (13:00 +0100)] 
gh-92782: unify the style of CFG traversal algorithms in the compiler (GH-92784)

3 years agoSummarize stats: Increase number of predecessor/successor pairs shown from 3 to 5...
Mark Shannon [Tue, 17 May 2022 09:59:24 +0000 (10:59 +0100)] 
Summarize stats: Increase number of predecessor/successor pairs shown from 3 to 5. (GH-92853)

3 years agoFix NULL test in _testinternalcapi (GH-92861)
Dennis Sweeney [Tue, 17 May 2022 01:32:48 +0000 (21:32 -0400)] 
Fix NULL test in _testinternalcapi (GH-92861)

3 years agore docs: fix source code link (#92819)
谭九鼎 [Tue, 17 May 2022 00:04:17 +0000 (08:04 +0800)] 
re docs: fix source code link (#92819)

3 years agogh-92265: set meta_path and path_hooks correctly in test_reload_namespace_changed...
Filipe Laíns [Mon, 16 May 2022 23:05:47 +0000 (00:05 +0100)] 
gh-92265: set meta_path and path_hooks correctly in test_reload_namespace_changed (GH-92275)

Previously, we were blocking the frozen imports and forcing the source
version to be used, but we did not fix up sys.meta_path or
sys.path_hooks, causing the frozen importers to leak into the source
version of the test.

3 years agogh-92547: Remove deprecated sqlite3 features (#92548)
Erlend Egeberg Aasland [Mon, 16 May 2022 17:52:08 +0000 (19:52 +0200)] 
gh-92547: Remove deprecated sqlite3 features (#92548)

The following sqlite3 features were deprecated in 3.10, scheduled for
removal in 3.12:

- sqlite3.OptimizedUnicode (gh-23163)
- sqlite3.enable_shared_cache (gh-24008)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Signed-off-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
3 years agogh-90473: Skip tests that don't apply to Emscripten and WASI (GH-92846)
Christian Heimes [Mon, 16 May 2022 14:02:37 +0000 (16:02 +0200)] 
gh-90473: Skip tests that don't apply to Emscripten and WASI (GH-92846)

3 years agoImprove object stats (#92845)
Mark Shannon [Mon, 16 May 2022 13:35:11 +0000 (14:35 +0100)] 
Improve object stats (#92845)

* Add incref/decref stats

* Show ratios for allocation in summary

3 years agogh-92671: Don't omit parentheses when unparsing empty tuples (GH-92673)
Batuhan Taskaya [Mon, 16 May 2022 12:38:06 +0000 (15:38 +0300)] 
gh-92671: Don't omit parentheses when unparsing empty tuples (GH-92673)

3 years agogh-92820: Skip test_cppext if _ctypes is missing (#92844)
Victor Stinner [Mon, 16 May 2022 11:54:45 +0000 (13:54 +0200)] 
gh-92820: Skip test_cppext if _ctypes is missing (#92844)

Add @test.support.requires_venv_with_pip decorator.

3 years agoSpeedup: build docs in parallel (GH-92733)
Hugo van Kemenade [Mon, 16 May 2022 11:52:00 +0000 (14:52 +0300)] 
Speedup: build docs in parallel (GH-92733)

3 years agogh-81548: Clarify the deprecation of octal sequences affect byte strings (GH-92643)
Pablo Galindo Salgado [Mon, 16 May 2022 10:42:58 +0000 (11:42 +0100)] 
gh-81548: Clarify the deprecation of octal sequences affect byte strings (GH-92643)

Automerge-Triggered-By: GH:pablogsal
3 years agogh-90473: WASI: Mark tests that require os.pipe() (GH-92837)
Christian Heimes [Mon, 16 May 2022 07:37:30 +0000 (09:37 +0200)] 
gh-90473: WASI: Mark tests that require os.pipe() (GH-92837)

3 years agogh-87670: Add web.archive redirects from effbot (GH-92816)
Stanley [Mon, 16 May 2022 06:11:43 +0000 (23:11 -0700)] 
gh-87670: Add web.archive redirects from effbot (GH-92816)

3 years agogh-92530: Fix an issue that occurred after interrupting threading.Condition.notify...
Serhiy Storchaka [Mon, 16 May 2022 05:25:29 +0000 (08:25 +0300)] 
gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify (GH-92534)

If Condition.notify() was interrupted just after it released the waiter lock,
but before removing it from the queue, the following calls of notify() failed
with RuntimeError: cannot release un-acquired lock.

3 years agoRestore default role check in `make check`. (#92290)
Ezio Melotti [Sun, 15 May 2022 15:34:52 +0000 (17:34 +0200)] 
Restore default role check in `make check`. (#92290)

* Restore default role check in `make check`.

* Options first, then files.

* Update `make.bat` too.

* Add a comment explaining the extra options.

* No reason to ignore the README.rst.

* Enable default-role check in sphinx-lint.

Co-authored-by: Julien Palard <julien@palard.fr>
* Update sphinx-lint default-role check.

* Fix use of the default role in the docs.

* Update make.bat to check for the default role too.

* Fix comment in make.bat.

Co-authored-by: Julien Palard <julien@palard.fr>
3 years agogh-89668: Optimize ZipFile file header processing algorithm to avoid unneeded IO...
Jan Wolski [Sun, 15 May 2022 14:49:19 +0000 (17:49 +0300)] 
gh-89668: Optimize ZipFile file header processing algorithm to avoid unneeded IO(gh-25966)

3 years agogh-92781: Avoid mixing declarations and code in C API (#92783)
Victor Stinner [Sun, 15 May 2022 09:19:52 +0000 (11:19 +0200)] 
gh-92781: Avoid mixing declarations and code in C API (#92783)

Avoid mixing declarations and code in the C API to fix the compiler
warning: "ISO C90 forbids mixed declarations and code"
[-Werror=declaration-after-statement].

3 years agogh-90473: Fail subprocess early on Emscripten/WASI (GH-92802)
Christian Heimes [Sat, 14 May 2022 18:23:19 +0000 (20:23 +0200)] 
gh-90473: Fail subprocess early on Emscripten/WASI (GH-92802)

3 years agoGH-92804: Fix memory leak in memoryview iterator (gh-92805)
Kumar Aditya [Sat, 14 May 2022 14:24:20 +0000 (19:54 +0530)] 
GH-92804: Fix memory leak in memoryview iterator (gh-92805)

3 years agogh-90861: Memory optimization for set.issubset (gh-92799)
Dong-hee Na [Sat, 14 May 2022 08:58:19 +0000 (17:58 +0900)] 
gh-90861: Memory optimization for set.issubset (gh-92799)

3 years agogh-92611: Link to PEP 594 sections & add key detail in doc deprecation notices (GH...
CAM Gerlach [Fri, 13 May 2022 19:54:12 +0000 (13:54 -0600)] 
gh-92611: Link to PEP 594 sections & add key detail in doc deprecation notices (GH-92612)

3 years agoFix numbers.Real.__rdivmod__ doc string (#31991)
Géry Ogam [Fri, 13 May 2022 14:49:36 +0000 (16:49 +0200)] 
Fix numbers.Real.__rdivmod__ doc string (#31991)

3 years agogh-91249: Remove .bat extension in documentation for when activating venv on Windows...
yashlad681 [Fri, 13 May 2022 14:36:05 +0000 (20:06 +0530)] 
gh-91249: Remove .bat extension in documentation for when activating venv on Windows. (GH-92770)

3 years agobpo-9182: Add a section on specifying positional arguments (#31810)
slateny [Fri, 13 May 2022 14:17:07 +0000 (07:17 -0700)] 
bpo-9182: Add a section on specifying positional arguments (#31810)

3 years agoFix small typo (#92721)
Gabi Nagy [Fri, 13 May 2022 14:15:20 +0000 (16:15 +0200)] 
Fix small typo (#92721)

3 years agogh-92446: Argparse choices should be a sequence (#92450)
180909 [Fri, 13 May 2022 14:06:08 +0000 (22:06 +0800)] 
gh-92446: Argparse choices should be a sequence (#92450)

3 years agoDocument Py_ssize_t. (GH-92512)
Julien Palard [Fri, 13 May 2022 12:10:16 +0000 (14:10 +0200)] 
Document Py_ssize_t. (GH-92512)

It fixes 252 errors from a Sphinx nitpicky run (sphinx-build -n). But
there's 8182 errors left.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
3 years agogh-85858: Remove PyUnicode_InternImmortal() function (#92579)
Victor Stinner [Fri, 13 May 2022 11:40:22 +0000 (13:40 +0200)] 
gh-85858: Remove PyUnicode_InternImmortal() function (#92579)

Remove the PyUnicode_InternImmortal() function and the
SSTATE_INTERNED_IMMORTAL macro.

The PyUnicode_InternImmortal() function is still exported in the
stable ABI. The function is removed from the API.

PyASCIIObject.state.interned size is now a single bit, rather than 2
bits.

Keep SSTATE_NOT_INTERNED and SSTATE_INTERNED_MORTAL macros for
backward compatibility, but no longer use them internally since the
interned member is now a single bit and so can only have two values
(interned or not interned).

Update stats of _PyUnicode_ClearInterned().

3 years agogh-89653: Use int type for Unicode kind (#92704)
Victor Stinner [Fri, 13 May 2022 10:41:05 +0000 (12:41 +0200)] 
gh-89653: Use int type for Unicode kind (#92704)

Use the same type that PyUnicode_FromKindAndData() kind parameter
type (public C API): int.

3 years agoGH-92236: Remove spurious "line" event when starting coroutine or generator. (GH...
Mark Shannon [Fri, 13 May 2022 10:24:45 +0000 (11:24 +0100)] 
GH-92236: Remove spurious "line" event when starting coroutine or generator. (GH-92722)

3 years agogh-89653: PEP 670: Convert PyUnicode_KIND() macro to function (#92705)
Victor Stinner [Fri, 13 May 2022 09:49:56 +0000 (11:49 +0200)] 
gh-89653: PEP 670: Convert PyUnicode_KIND() macro to function (#92705)

In the limited C API version 3.12, PyUnicode_KIND() is now
implemented as a static inline function. Keep the macro for the
regular C API and for the limited C API version 3.11 and older to
prevent introducing new compiler warnings.

Update _decimal.c and stringlib/eq.h for PyUnicode_KIND().

3 years agogh-90473: Increase stack size, disable obmalloc on WASI (GH-92732)
Christian Heimes [Fri, 13 May 2022 06:36:01 +0000 (08:36 +0200)] 
gh-90473: Increase stack size, disable obmalloc on WASI (GH-92732)

3 years agogh-92536: Doc update about Py_UNICODE removal (GH-92756)
Inada Naoki [Fri, 13 May 2022 04:15:41 +0000 (13:15 +0900)] 
gh-92536: Doc update about Py_UNICODE removal (GH-92756)

3 years agogh-92584: test_cppext uses setuptools (#92639)
Victor Stinner [Thu, 12 May 2022 22:20:13 +0000 (00:20 +0200)] 
gh-92584: test_cppext uses setuptools (#92639)

Rewrite test_cppext to run in a virtual environment and to build the
C++ extension with setuptools rather than distutils.

3 years agogh-92311: Add tests for frame_setlineno jumping over listcomps (#92741)
Dennis Sweeney [Thu, 12 May 2022 21:43:54 +0000 (17:43 -0400)] 
gh-92311: Add tests for frame_setlineno jumping over listcomps (#92741)

3 years agoCheck result of utc_to_seconds and skip fold probe in pure Python (#91582)
Paul Ganssle [Thu, 12 May 2022 21:00:50 +0000 (17:00 -0400)] 
Check result of utc_to_seconds and skip fold probe in pure Python (#91582)

The `utc_to_seconds` call can fail, here's a minimal reproducer on
Linux:

TZ=UTC python -c "from datetime import *; datetime.fromtimestamp(253402300799 + 1)"

The old behavior still raised an error in a similar way, but only
because subsequent calculations happened to fail as well. Better to fail
fast.

This also refactors the tests to split out the `fromtimestamp` and
`utcfromtimestamp` tests, and to get us closer to the actual desired
limits of the functions. As part of this, we also changed the way we
detect platforms where the same limits don't necessarily apply (e.g.
Windows).

As part of refactoring the tests to hit this condition explicitly (even
though the user-facing behvior doesn't change in any way we plan to
guarantee), I noticed that there was a difference in the places that
`datetime.utcfromtimestamp` fails in the C and pure Python versions, which
was fixed by skipping the "probe for fold" logic for UTC specifically —
since UTC doesn't have any folds or gaps, we were never going to find a
fold value anyway. This should prevent some failures in the pure python
`utcfromtimestamp` method on timestamps close to 0001-01-01.

There are two separate news entries for this because one is a
potentially user-facing change, the other is an internal code
correctness change that, if anything, changes some error messages. The
two happen to be coupled because of the test refactoring, but they are
probably best thought of as independent changes.

Fixes GH-91581

3 years agoAdd notes for maintaining ABCs (#92736)
Raymond Hettinger [Thu, 12 May 2022 18:18:39 +0000 (13:18 -0500)] 
Add notes for maintaining ABCs (#92736)

3 years agogh-91578: improved error message when trying to instantiate an abstract class with...
ravi140222 [Thu, 12 May 2022 15:26:11 +0000 (20:56 +0530)] 
gh-91578: improved error message when trying to instantiate an abstract class with missing methods (gh-47246)

3 years agogh-92514: Remove unused test.support.BasicTestRunner (#92515)
Jelle Zijlstra [Thu, 12 May 2022 14:24:04 +0000 (07:24 -0700)] 
gh-92514: Remove unused test.support.BasicTestRunner (#92515)

3 years agogh-92436: __future__ docs: add note on expectations for "from __future__ import annot...
Jelle Zijlstra [Thu, 12 May 2022 14:23:42 +0000 (07:23 -0700)] 
gh-92436: __future__ docs: add note on expectations for "from __future__ import annotations" (#92568)

3 years agoUpdate outdated `LOAD_METHOD` comments in `Python/ceval.c` (GH-92641)
Crowthebird [Thu, 12 May 2022 12:37:55 +0000 (20:37 +0800)] 
Update outdated `LOAD_METHOD` comments in `Python/ceval.c` (GH-92641)

3 years agogh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)
Inada Naoki [Thu, 12 May 2022 05:48:38 +0000 (14:48 +0900)] 
gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)

3 years agogh-86388 Remove deprecated behaviors in randrange() (#92677)
Raymond Hettinger [Thu, 12 May 2022 04:54:51 +0000 (23:54 -0500)] 
gh-86388 Remove deprecated behaviors in randrange() (#92677)

3 years agoFix typo in argparse docs. (GH-92691)
thueringa [Thu, 12 May 2022 03:25:09 +0000 (05:25 +0200)] 
Fix typo in argparse docs. (GH-92691)

# Fix typo in argparse docs.

> Sometimes, when dealing with **a** particularly long argument list**s**, [...]

Mixture between plural and singular forms is incorrect. Use singular consistently since typically only a single argument list is employed. Change to:

> Sometimes, when dealing with a particularly long argument list, [...]

No issue was opened, since this is a trivial change.

Automerge-Triggered-By: GH:rhettinger
3 years agogh-89653: PEP 670: Fix Sphinx syntax in Unicode doc (#92707)
Victor Stinner [Thu, 12 May 2022 01:38:49 +0000 (03:38 +0200)] 
gh-89653: PEP 670: Fix Sphinx syntax in Unicode doc (#92707)

3 years agogh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (#92696)
Victor Stinner [Wed, 11 May 2022 23:35:41 +0000 (01:35 +0200)] 
gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (#92696)

Use _Py_CAST() and _Py_STATIC_CAST() in macros wrapping static inline
functions of unicodeobject.h.

Change also the kind type from unsigned int to int: same parameter
type than PyUnicode_FromKindAndData().

The limited API version 3.11 no longer casts arguments to expected
types.

3 years agogh-89653: PEP 670: Update C API unicode documentation (#92702)
Victor Stinner [Wed, 11 May 2022 23:33:52 +0000 (01:33 +0200)] 
gh-89653: PEP 670: Update C API unicode documentation (#92702)

3 years agogh-89653: PEP 670: Convert PyDict_GET_SIZE() macro to function (#92695)
Victor Stinner [Wed, 11 May 2022 22:58:42 +0000 (00:58 +0200)] 
gh-89653: PEP 670: Convert PyDict_GET_SIZE() macro to function (#92695)

The limited C API version 3.12 no longer casts the argument.

3 years agoFix minor documentation error in bisect docs (GH-92697)
Steve Dower [Wed, 11 May 2022 22:56:58 +0000 (23:56 +0100)] 
Fix minor documentation error in bisect docs (GH-92697)

3 years agogh-92031, test_embed: Improve test for unquickening static code (#92440)
Dennis Sweeney [Wed, 11 May 2022 22:54:00 +0000 (18:54 -0400)] 
gh-92031, test_embed: Improve test for unquickening static code (#92440)

3 years agogh-89653: PEP 670: Use PyObject* type for parameters (#92694)
Victor Stinner [Wed, 11 May 2022 22:49:03 +0000 (00:49 +0200)] 
gh-89653: PEP 670: Use PyObject* type for parameters (#92694)

Use the PyObject* type for parameters of static inline functions:

* Py_SIZE(): same parameter type than PyObject_Size()
* PyList_GET_SIZE(), PyList_SET_ITEM(): same parameter type than
  PyList_Size() and PyList_SetItem()
* PyTuple_GET_SIZE(), PyTuple_SET_ITEM(): same parameter type than
  PyTuple_Size() and PyTuple_SetItem().

3 years agogh-89653: Add assertions to unicodeobject.h functions (#92692)
Victor Stinner [Wed, 11 May 2022 22:12:42 +0000 (00:12 +0200)] 
gh-89653: Add assertions to unicodeobject.h functions (#92692)

3 years agogh-89653: PEP 670: Limited API doesn't cast arguments (#92654)
Victor Stinner [Wed, 11 May 2022 22:01:42 +0000 (00:01 +0200)] 
gh-89653: PEP 670: Limited API doesn't cast arguments (#92654)

The limited API version 3.11 no longer casts arguments to expected
types of functions of functions:

* PyList_GET_SIZE(), PyList_SET_ITEM()
* PyTuple_GET_SIZE(), PyTuple_SET_ITEM()
* PyWeakref_GET_OBJECT()

3 years agogh-89653: PEP 670: Convert unicodeobject.h macros to functions (#92648)
Victor Stinner [Wed, 11 May 2022 21:28:39 +0000 (23:28 +0200)] 
gh-89653: PEP 670: Convert unicodeobject.h macros to functions (#92648)

Convert the following Unicode macros to static inline functions.

Surrogate functions:

* Py_UNICODE_IS_SURROGATE()
* Py_UNICODE_IS_HIGH_SURROGATE()
* Py_UNICODE_IS_LOW_SURROGATE()
* Py_UNICODE_HIGH_SURROGATE()
* Py_UNICODE_LOW_SURROGATE()
* Py_UNICODE_JOIN_SURROGATES()

"Is" functions:

* Py_UNICODE_ISALNUM()
* Py_UNICODE_ISSPACE()

In the implementation of these functions, the character type is now
well defined to Py_UCS4.

3 years agogh-90978: asyncio TestSSL uses SHORT_TIMEOUT (#92642)
Victor Stinner [Wed, 11 May 2022 21:25:56 +0000 (23:25 +0200)] 
gh-90978: asyncio TestSSL uses SHORT_TIMEOUT (#92642)

TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than
hardcoded timeouts like 5, 10 or 40 seconds.

3 years agogh-89653: PEP 670: Convert PyCell macros to functions (#92653)
Victor Stinner [Wed, 11 May 2022 21:24:48 +0000 (23:24 +0200)] 
gh-89653: PEP 670: Convert PyCell macros to functions (#92653)

Convert the following macros to static inline functions:

* PyCell_GET()
* PyCell_SET()

Limited C API version 3.12 no longer casts arguments.

Fix also usage of PyCell_SET(): only delete the old value after
setting the new value.

3 years agogh-92651: Remove the Include/token.h header file (#92652)
Victor Stinner [Wed, 11 May 2022 21:22:50 +0000 (23:22 +0200)] 
gh-92651: Remove the Include/token.h header file (#92652)

Remove the token.h header file. There was never any public tokenizer
C API. The token.h header file was only designed to be used by Python
internals.

Move Include/token.h to Include/internal/pycore_token.h. Including
this header file now requires that the Py_BUILD_CORE macro is
defined. It no longer checks for the Py_LIMITED_API macro.

Rename functions:

* PyToken_OneChar() => _PyToken_OneChar()
* PyToken_TwoChars() => _PyToken_TwoChars()
* PyToken_ThreeChars() => _PyToken_ThreeChars()

3 years agobpo-42627: Fix incorrect parsing of Windows registry proxy settings (GH-26307)
狂男风 [Wed, 11 May 2022 18:17:17 +0000 (02:17 +0800)] 
bpo-42627: Fix incorrect parsing of Windows registry proxy settings (GH-26307)

3 years agogh-89653: PEP 670: Convert pycore_gc.h macros to functions (#92649)
Victor Stinner [Wed, 11 May 2022 11:37:18 +0000 (13:37 +0200)] 
gh-89653: PEP 670: Convert pycore_gc.h macros to functions (#92649)

Convert the following macros to static inline functions:

* _Py_AS_GC()
* _PyGCHead_FINALIZED(), _PyGCHead_SET_FINALIZED()
* _PyGCHead_NEXT(), _PyGCHead_SET_NEXT()
* _PyGCHead_PREV(), _PyGCHead_SET_PREV()
* _PyGC_FINALIZED(), _PyGC_SET_FINALIZED()
* _PyObject_GC_IS_TRACKED()
* _PyObject_GC_MAY_BE_TRACKED()

Add a macro wrapping the _PyObject_GC_IS_TRACKED() function to cast
the argument to PyObject*.

3 years agogh-91810: ElementTree: Use text file's encoding by default in XML declaration (GH...
Serhiy Storchaka [Wed, 11 May 2022 06:31:07 +0000 (09:31 +0300)] 
gh-91810: ElementTree: Use text file's encoding by default in XML declaration (GH-91903)

ElementTree method write() and function tostring() now use the text file's
encoding ("UTF-8" if not available) instead of locale encoding in XML
declaration when encoding="unicode" is specified.

3 years agogh-89336: Fix configparser.RawConfigParser.readfp typo (GH-92636)
Hugo van Kemenade [Wed, 11 May 2022 06:18:45 +0000 (09:18 +0300)] 
gh-89336: Fix configparser.RawConfigParser.readfp typo (GH-92636)

3 years agoFix typo in unittest.rst: addCleanupModule -> addModuleCleanup (GH-92631)
Mikhail Terekhov [Wed, 11 May 2022 06:14:12 +0000 (02:14 -0400)] 
Fix typo in unittest.rst: addCleanupModule -> addModuleCleanup (GH-92631)

3 years agogh-92632: Make function starunpack_helper run faster when encounters starred argument...
zikcheng [Wed, 11 May 2022 06:09:40 +0000 (14:09 +0800)] 
gh-92632: Make function starunpack_helper run faster when encounters starred argument. (GH-92655)

3 years agogh-92550: Fix pathlib.Path.rglob() for empty pattern (GH-92604)
Serhiy Storchaka [Wed, 11 May 2022 04:43:04 +0000 (07:43 +0300)] 
gh-92550: Fix pathlib.Path.rglob() for empty pattern (GH-92604)

3 years agoRevert "gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)" (GH-92598)
Serhiy Storchaka [Wed, 11 May 2022 04:14:25 +0000 (07:14 +0300)] 
Revert "gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)" (GH-92598)

This reverts commit dcdf250d2de1428f7d8b4e9ecf51d2fd8200e21a.

3 years agogh-92584: test_decimal uses shutil.which() (#92640)
Victor Stinner [Tue, 10 May 2022 23:42:09 +0000 (01:42 +0200)] 
gh-92584: test_decimal uses shutil.which() (#92640)

test_decimal now uses shutil.which() rather than deprecated
distutils.spawn.find_executable().

3 years agoWhat's New 3.12: PyFrame_BlockSetup() was removed in 3.11 (#92645)
Victor Stinner [Tue, 10 May 2022 23:28:17 +0000 (01:28 +0200)] 
What's New 3.12: PyFrame_BlockSetup() was removed in 3.11 (#92645)

What's New in Python 3.11: "PyFrame_BlockSetup() and
PyFrame_BlockPop() have been removed.  (Contributed by Mark Shannon
in bpo-40222.)"
https://docs.python.org/dev/whatsnew/3.11.html#id8

3 years agogh-91966 Document where key functions are applied in the bisect module (#92602)
Raymond Hettinger [Tue, 10 May 2022 22:18:58 +0000 (17:18 -0500)] 
gh-91966 Document where key functions are applied in the bisect module (#92602)

3 years agobpo-39264: Fix UserDict.get() to account for __missing__() (GH-17910)
Bar Harel [Tue, 10 May 2022 21:23:45 +0000 (00:23 +0300)] 
bpo-39264: Fix UserDict.get() to account for __missing__() (GH-17910)

Here's the patch according to the discussion at the [Python-Dev mailing list](https://mail.python.org/archives/list/python-dev@python.org/thread/SDXOEMAEM6KQ3CQCJVBVRT5QNSPAVU6X/).
UserDict.get() will match dict's behavior and not call `__missing__`.

Automerge-Triggered-By: GH:rhettinger
3 years agobpo-39278: add docstrings to functions in pdb module (#17924)
Carl Bordum Hansen [Tue, 10 May 2022 20:59:58 +0000 (22:59 +0200)] 
bpo-39278: add docstrings to functions in pdb module (#17924)

3 years agobpo-43689: improve documentation for Differ (GH-25132)
Jürgen Gmach [Tue, 10 May 2022 20:57:12 +0000 (22:57 +0200)] 
bpo-43689: improve documentation for Differ (GH-25132)

Lines beginning with ``?`` try to help understanding the given diff.

The output can be hard to understand when it contains whitespace characters, such as spaces, tabs or line breaks.

While previously only tabs were mentioned, now all are listed.

Automerge-Triggered-By: GH:rhettinger
3 years agogh-84131: Remove the deprecated pathlib.Path.link_to method. (#92505)
Gregory P. Smith [Tue, 10 May 2022 19:31:41 +0000 (12:31 -0700)] 
gh-84131: Remove the deprecated pathlib.Path.link_to method. (#92505)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
3 years agoUpdate numbers.rst (#31995)
Géry Ogam [Tue, 10 May 2022 18:01:49 +0000 (20:01 +0200)] 
Update numbers.rst (#31995)

3 years agobpo-42259: clarify pprint saferepr docs (#30256)
andrei kulakov [Tue, 10 May 2022 17:22:36 +0000 (13:22 -0400)] 
bpo-42259: clarify pprint saferepr docs (#30256)

3 years agogh-80143: Add clarification for escape characters (#92292)
slateny [Tue, 10 May 2022 16:12:29 +0000 (09:12 -0700)] 
gh-80143: Add clarification for escape characters (#92292)

3 years agogh-91731: Fix typo in pymacro.h (#92618)
Pablo Galindo Salgado [Tue, 10 May 2022 12:47:22 +0000 (13:47 +0100)] 
gh-91731: Fix typo in pymacro.h (#92618)

* Fix typo in pymacro.h

* Update Include/pymacro.h

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 years agogh-92619: Fix bug where the compiler duplicates exit blocks unnecessarily (GH-92620)
Irit Katriel [Tue, 10 May 2022 12:36:08 +0000 (13:36 +0100)] 
gh-92619: Fix bug where the compiler duplicates exit blocks unnecessarily (GH-92620)

3 years agoAdd `__slots__` to `typing._NotIterable` (GH-92570)
Alex Waygood [Tue, 10 May 2022 09:17:54 +0000 (10:17 +0100)] 
Add `__slots__` to `typing._NotIterable` (GH-92570)