]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoFix typo in multiprocessing docs (#108666)
kato8966 [Wed, 30 Aug 2023 11:05:29 +0000 (20:05 +0900)] 
Fix typo in multiprocessing docs (#108666)

2 years agogh-108669: unittest: Fix documentation for TestResult.collectedDurations (#108670)
Sebastian Rittau [Wed, 30 Aug 2023 09:36:59 +0000 (11:36 +0200)] 
gh-108669: unittest: Fix documentation for TestResult.collectedDurations (#108670)

2 years agogh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (#108657)
Corvin [Wed, 30 Aug 2023 09:06:21 +0000 (05:06 -0400)] 
gh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (#108657)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agoRevert "gh-103224: Use the realpath of the Python executable in `test_venv` (GH-10324...
Serhiy Storchaka [Wed, 30 Aug 2023 08:41:04 +0000 (11:41 +0300)] 
Revert "gh-103224: Use the realpath of the Python executable in `test_venv` (GH-103243)" (GH-108667)

This reverts commit 85b0b0cd947c5218260fb2bc2014c8c8de172d33.

It broke builtbots.

2 years agogh-106320: Remove private _Py_ForgetReference() (#108664)
Victor Stinner [Wed, 30 Aug 2023 03:34:43 +0000 (05:34 +0200)] 
gh-106320: Remove private _Py_ForgetReference() (#108664)

Move the private _Py_ForgetReference() function to the internal C API
(pycore_object.h).

2 years agoMention Ellipsis pickling in the docs (#103660)
sterliakov [Wed, 30 Aug 2023 01:11:31 +0000 (04:11 +0300)] 
Mention Ellipsis pickling in the docs (#103660)

2 years agoRevert "Use non alternate name for Kyiv (GH-108533)" (GH-108649)
Serhiy Storchaka [Tue, 29 Aug 2023 20:08:45 +0000 (23:08 +0300)] 
Revert "Use non alternate name for Kyiv (GH-108533)" (GH-108649)

This reverts commit 7659128b9d7a30ddbcb063bc12e2ddb0f1f119e0.

It broke tests on the Debian and macOS buildbots.

2 years agogh-108278: Deprecate passing the first param of sqlite3.Connection callback APIs...
Erlend E. Aasland [Tue, 29 Aug 2023 20:02:12 +0000 (22:02 +0200)] 
gh-108278: Deprecate passing the first param of sqlite3.Connection callback APIs by keyword (#108632)

Deprecate passing the callback callable by keyword for the following
sqlite3.Connection APIs:

- set_authorizer(authorizer_callback)
- set_progress_handler(progress_handler, ...)
- set_trace_callback(trace_callback)

The affected parameters will become positional-only in Python 3.15.

2 years agogh-108455: peg_generator: install two stubs packages before running mypy (#108637)
Alex Waygood [Tue, 29 Aug 2023 19:14:08 +0000 (20:14 +0100)] 
gh-108455: peg_generator: install two stubs packages before running mypy (#108637)

2 years agogh-107801: Improve the accuracy of io.IOBase.seek docs (#108268)
Erlend E. Aasland [Tue, 29 Aug 2023 19:13:38 +0000 (21:13 +0200)] 
gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268)

- Add param docstrings
- Link to os.SEEK_* constants
- Mention the return value in the initial paragraph

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agogh-108488: Initialize JUMP_BACKWARD cache to 0, not 17 (#108591)
Guido van Rossum [Tue, 29 Aug 2023 18:14:56 +0000 (11:14 -0700)] 
gh-108488: Initialize JUMP_BACKWARD cache to 0, not 17 (#108591)

This mis-initialization caused the executor optimization to kick in sooner than intended. It also set the lower 4 bits of the counter to `1` -- those bits are supposed to be reserved (the actual counter is in the upper 12 bits).

2 years agogh-107557: Remove unnecessary SAVE_IP instructions (#108583)
Guido van Rossum [Tue, 29 Aug 2023 16:51:51 +0000 (09:51 -0700)] 
gh-107557: Remove unnecessary SAVE_IP instructions (#108583)

Also remove NOP instructions.

The "stubs" are not optimized in this fashion (their SAVE_IP should always be preserved since it's where to jump next, and they don't contain NOPs by their nature).

2 years agotest_sys: remove debug print() (#108642)
Victor Stinner [Tue, 29 Aug 2023 16:04:07 +0000 (18:04 +0200)] 
test_sys: remove debug print() (#108642)

2 years agogh-108638: Fix stat.filemode() when _stat is missing (#108639)
Victor Stinner [Tue, 29 Aug 2023 15:46:46 +0000 (17:46 +0200)] 
gh-108638: Fix stat.filemode() when _stat is missing (#108639)

Change the pure Python implementation of stat.filemode() for unknown
file type: use "?", as done by the _stat.filemode().

test_stat skips TestFilemodeCStat if the _stat extension is missing.

2 years agoUse non alternate name for Kyiv (GH-108533)
Jochen Sprickerhof [Tue, 29 Aug 2023 15:00:43 +0000 (17:00 +0200)] 
Use non alternate name for Kyiv (GH-108533)

tzdata provides Kiev as an alternative to Kyiv:

https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314#L314

But Debian moved it to the tzdata-legacy package breaking the test:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530

This patch switches to the name provided by tzdata.

2 years agogh-108635: Make parameters of some implementations of special methods positional...
Serhiy Storchaka [Tue, 29 Aug 2023 14:55:56 +0000 (17:55 +0300)] 
gh-108635: Make parameters of some implementations of special methods positional-only (GH-108636)

2 years agogh-108455: peg generator: Use `strict_optional=True` for `grammar_parser` (#108629)
Nikita Sobolev [Tue, 29 Aug 2023 12:02:52 +0000 (15:02 +0300)] 
gh-108455: peg generator: Use `strict_optional=True` for `grammar_parser` (#108629)

2 years agogh-108623: Fix compile warning in `Modules/_multiprocessing/semaphore.c` (#108624)
Nikita Sobolev [Tue, 29 Aug 2023 11:43:11 +0000 (14:43 +0300)] 
gh-108623: Fix compile warning in `Modules/_multiprocessing/semaphore.c` (#108624)

2 years agogh-108494: Don't build _testclinic_limited with TraceRefs (#108608)
Victor Stinner [Tue, 29 Aug 2023 11:39:42 +0000 (13:39 +0200)] 
gh-108494: Don't build _testclinic_limited with TraceRefs (#108608)

If Python is built with ./configure --with-trace-refs, don't build
the _testclinic_limited extension. The limited C API (Py_LIMITED_API)
is not compatible with Py_TRACE_REFS.

2 years agogh-108494: Argument Clinic: fix option group for Limited C API (#108574)
Victor Stinner [Tue, 29 Aug 2023 11:33:28 +0000 (13:33 +0200)] 
gh-108494: Argument Clinic: fix option group for Limited C API (#108574)

Use PyTuple_Size() instead of PyTuple_GET_SIZE().

2 years agogh-108455: peg_generator: make the mypy config slightly stricter (#108627)
Alex Waygood [Tue, 29 Aug 2023 11:23:22 +0000 (12:23 +0100)] 
gh-108455: peg_generator: make the mypy config slightly stricter (#108627)

* Enable `--no-implicit-reexport`

* Enable the `truthy-bool` error code

* Enable the `ignore-without-code` error code

* Explicitly note that `--warn-unreachable` cannot yet be enabled

2 years agogh-108455: Simplify the peg_generator mypy config (#108620)
Alex Waygood [Tue, 29 Aug 2023 10:24:06 +0000 (11:24 +0100)] 
gh-108455: Simplify the peg_generator mypy config (#108620)

make it easier to see exactly which options from mypy's `--strict` mode can't currently be enabled

2 years agogh-108617: Extend interactive session tests for sqlite3 (GH-108556)
Serhiy Storchaka [Tue, 29 Aug 2023 10:20:32 +0000 (13:20 +0300)] 
gh-108617: Extend interactive session tests for sqlite3 (GH-108556)

2 years agogh-108550: Fix sqlite3 CLI regression from gh-108551 (#108618)
Erlend E. Aasland [Tue, 29 Aug 2023 09:39:42 +0000 (11:39 +0200)] 
gh-108550: Fix sqlite3 CLI regression from gh-108551 (#108618)

2 years agogh-108558: Improve sqlite3 row factory tests (#108578)
Edward Schauman-Haigh [Tue, 29 Aug 2023 08:51:36 +0000 (10:51 +0200)] 
gh-108558: Improve sqlite3 row factory tests (#108578)

Add test_sqlite_row_keys() to explicitly test sqlite3.Row.keys().

Cleanups:
- Reduce test noise by converting docstrings to regular comments
- Reduce boilerplate code by adding a setUp() method to RowFactoryTests

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agoGH-106176, GH-104702: Fix reference leak when importing across multiple threads ...
Brett Cannon [Tue, 29 Aug 2023 07:17:25 +0000 (00:17 -0700)] 
GH-106176, GH-104702: Fix reference leak when importing across multiple threads (#108497)

2 years agogh-106320: Fix test_peg_generator: _Py_UniversalNewlineFgetsWithSize() (#108609)
Victor Stinner [Tue, 29 Aug 2023 03:40:13 +0000 (05:40 +0200)] 
gh-106320: Fix test_peg_generator: _Py_UniversalNewlineFgetsWithSize() (#108609)

Fix test_peg_generator by exporting the
_Py_UniversalNewlineFgetsWithSize() function.

2 years agogh-106320: Remove private _PyObject_GetState() (#108606)
Victor Stinner [Tue, 29 Aug 2023 03:38:51 +0000 (05:38 +0200)] 
gh-106320: Remove private _PyObject_GetState() (#108606)

Move the private _PyObject_GetState() function to the internal C API
(pycore_object.h).

2 years agogh-106320: Remove private _PyOS_IsMainThread() function (#108605)
Victor Stinner [Tue, 29 Aug 2023 03:20:31 +0000 (05:20 +0200)] 
gh-106320: Remove private _PyOS_IsMainThread() function (#108605)

Move the following private API to the internal C API
(pycore_signal.h): _PyOS_IsMainThread() and _PyOS_SigintEvent().

2 years agogh-106320: Remove private _PyErr_SetKeyError() (#108607)
Victor Stinner [Tue, 29 Aug 2023 03:13:41 +0000 (05:13 +0200)] 
gh-106320: Remove private _PyErr_SetKeyError() (#108607)

Move the private _PyErr_SetKeyError() function to the internal C API
(pycore_pyerrors.h).

2 years agogh-106320: Remove private _PyLong_New() function (#108604)
Victor Stinner [Tue, 29 Aug 2023 02:59:49 +0000 (04:59 +0200)] 
gh-106320: Remove private _PyLong_New() function (#108604)

Move the following private API to the internal C API (pycore_long.h):

* _PyLong_Copy()
* _PyLong_FromDigits()
* _PyLong_New()

No longer export most of these functions.

2 years agogh-106320: Remove private _PyGILState_GetInterpreterStateUnsafe() (#108603)
Victor Stinner [Tue, 29 Aug 2023 02:44:38 +0000 (04:44 +0200)] 
gh-106320: Remove private _PyGILState_GetInterpreterStateUnsafe() (#108603)

The remove private _PyGILState_GetInterpreterStateUnsafe() function
from the public C API: move it the internal C API (pycore_pystate.h).
No longer export the function.

2 years agogh-106320: Remove private _PyThread_at_fork_reinit() function (#108601)
Victor Stinner [Tue, 29 Aug 2023 02:38:23 +0000 (04:38 +0200)] 
gh-106320: Remove private _PyThread_at_fork_reinit() function (#108601)

Move the private function to the internal C API (pycore_pythread.h)
and no longer exports it.

2 years agogh-106320: Remove private _Py_UniversalNewlineFgetsWithSize() (#108602)
Victor Stinner [Tue, 29 Aug 2023 02:36:50 +0000 (04:36 +0200)] 
gh-106320: Remove private _Py_UniversalNewlineFgetsWithSize() (#108602)

The remove private _Py_UniversalNewlineFgetsWithSize() function from
the public C API: move it the internal C API (pycore_fileutils.h).
No longer export the function.

2 years agogh-106320: Remove private pythonrun API (#108599)
Victor Stinner [Tue, 29 Aug 2023 02:18:52 +0000 (04:18 +0200)] 
gh-106320: Remove private pythonrun API (#108599)

Remove these private functions from the public C API:

* _PyRun_AnyFileObject()
* _PyRun_InteractiveLoopObject()
* _PyRun_SimpleFileObject()
* _Py_SourceAsString()

Move them to the internal C API: add a new pycore_pythonrun.h header
file. No longer export these functions.

2 years agogh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597)
Victor Stinner [Tue, 29 Aug 2023 02:05:11 +0000 (04:05 +0200)] 
gh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597)

It's not needed to declare it in Include/iterobject.h: just use
"extern" where it's used (only in object.c).

2 years agogh-108240: Add pycore_capsule.h internal header file (#108596)
Victor Stinner [Tue, 29 Aug 2023 01:20:02 +0000 (03:20 +0200)] 
gh-108240: Add pycore_capsule.h internal header file (#108596)

Move _PyCapsule_SetTraverse() definition to a new internal header
file: pycore_capsule.h.

2 years agogh-106320: Remove private _Py_Identifier API (#108593)
Victor Stinner [Tue, 29 Aug 2023 00:29:46 +0000 (02:29 +0200)] 
gh-106320: Remove private _Py_Identifier API (#108593)

Remove the private _Py_Identifier type and related private functions
from the public C API:

* _PyObject_GetAttrId()
* _PyObject_LookupSpecialId()
* _PyObject_SetAttrId()
* _PyType_LookupId()
* _Py_IDENTIFIER()
* _Py_static_string()
* _Py_static_string_init()

Move them to the internal C API: add a new pycore_identifier.h header
file. No longer export these functions.

2 years agoFix misc doc typos (#108592)
xzmeng [Tue, 29 Aug 2023 00:14:21 +0000 (08:14 +0800)] 
Fix misc doc typos (#108592)

2 years agogh-108494: Build _testclinic_limited on Windows (#108589)
Victor Stinner [Mon, 28 Aug 2023 23:51:39 +0000 (01:51 +0200)] 
gh-108494: Build _testclinic_limited on Windows (#108589)

Add _testclinic_limited project to the Visual Studio solution:

* In "PCbuild/", copy "_asyncio.vcxproj" to "_testclinic_limited.vcxproj",
  replace "RootNamespace" with "_testclinic_limited", replace "_asyncio.c"
  with "_testclinic_limited.c".
* Open Visual Studio, open "PCbuild\pcbuild.sln", add the existing
  "PCbuild\_testclinic_limited.vcxproj" project to the solution.
* Add a dependency from "python" project to the "_testclinic_limited"
  project.
* Save and exit Visual Studio.
* Add ";_testclinic_limited" to "<TestModules Include="...">"
  in "PCbuild\pcbuild.proj".

2 years agogh-107149: Rename _PyUnstable_GetUnaryIntrinsicName() function (#108441)
Victor Stinner [Mon, 28 Aug 2023 23:42:24 +0000 (01:42 +0200)] 
gh-107149: Rename _PyUnstable_GetUnaryIntrinsicName() function (#108441)

* Rename _PyUnstable_GetUnaryIntrinsicName() to
  PyUnstable_GetUnaryIntrinsicName()
* Rename _PyUnstable_GetBinaryIntrinsicName()
  to PyUnstable_GetBinaryIntrinsicName().

2 years agoGH-107603: Clinic: Pass specific attributes to ``print_block()`` (#108581)
Adam Turner [Mon, 28 Aug 2023 21:31:45 +0000 (22:31 +0100)] 
GH-107603: Clinic: Pass specific attributes to ``print_block()`` (#108581)

2 years agogh-108455: Run `mypy` on `Tools/peg_generator` (#108456)
Nikita Sobolev [Mon, 28 Aug 2023 20:04:12 +0000 (23:04 +0300)] 
gh-108455: Run `mypy` on `Tools/peg_generator` (#108456)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-106670: Allow Pdb to move between chained exceptions (#106676)
Matthias Bussonnier [Mon, 28 Aug 2023 18:31:03 +0000 (20:31 +0200)] 
gh-106670: Allow Pdb to move between chained exceptions (#106676)

2 years agogh-108494: Argument clinic: Improve the `parse_file()` API (#108575)
Alex Waygood [Mon, 28 Aug 2023 18:25:16 +0000 (19:25 +0100)] 
gh-108494: Argument clinic: Improve the `parse_file()` API (#108575)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-108487: Move assert(self != NULL) down beyond DEOPT_IF() (#108510)
Guido van Rossum [Mon, 28 Aug 2023 17:17:00 +0000 (10:17 -0700)] 
gh-108487: Move assert(self != NULL) down beyond DEOPT_IF() (#108510)

2 years agogh-108278: Deprecate passing the three first params as keyword args for sqlite3 UDF...
Erlend E. Aasland [Mon, 28 Aug 2023 13:32:07 +0000 (15:32 +0200)] 
gh-108278: Deprecate passing the three first params as keyword args for sqlite3 UDF creation APIs (#108281)

Deprecate passing name, number of arguments, and the callable as keyword
arguments, for the following sqlite3.Connection APIs:

- create_function(name, nargs, callable, ...)
- create_aggregate(name, nargs, callable)

The affected parameters will become positional-only in Python 3.15.

2 years agogh-108494: Argument Clinic: fix support of Limited C API (GH-108536)
Serhiy Storchaka [Mon, 28 Aug 2023 13:04:27 +0000 (16:04 +0300)] 
gh-108494: Argument Clinic: fix support of Limited C API (GH-108536)

2 years agogh-104683: Argument Clinic: Refactor the module and class resolver (#108552)
Erlend E. Aasland [Mon, 28 Aug 2023 12:41:05 +0000 (14:41 +0200)] 
gh-104683: Argument Clinic: Refactor the module and class resolver (#108552)

2 years agogh-108550: Speed up sqlite3 tests (#108551)
Erlend E. Aasland [Mon, 28 Aug 2023 12:17:34 +0000 (14:17 +0200)] 
gh-108550: Speed up sqlite3 tests (#108551)

Refactor the CLI so we can easily invoke it and mock command-line
arguments. Adapt the CLI tests so we no longer have to launch a
separate process.

Disable the busy handler for all concurrency tests; we have full
control over the order of the SQLite C API calls, so we can safely
do this.

The sqlite3 test suite now completes ~8 times faster than before.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-64662: Fix NEWS entry and remove What's New entry (#108565)
Erlend E. Aasland [Mon, 28 Aug 2023 12:02:26 +0000 (14:02 +0200)] 
gh-64662: Fix NEWS entry and remove What's New entry (#108565)

2 years agoFix typo in typing docs: Remove redundant backtick (#108559)
nikkie [Mon, 28 Aug 2023 11:19:29 +0000 (20:19 +0900)] 
Fix typo in typing docs: Remove redundant backtick (#108559)

2 years agoGH-108202: Combine documentation of ``calendar`` constants (#108492)
Adam Turner [Mon, 28 Aug 2023 05:19:31 +0000 (06:19 +0100)] 
GH-108202: Combine documentation of ``calendar`` constants (#108492)

2 years agogh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)
Erlend E. Aasland [Sun, 27 Aug 2023 22:18:32 +0000 (00:18 +0200)] 
gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)

Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2 years agogh-108465: Use compiler basename when determining compiler flags (#108392)
John Micco [Sun, 27 Aug 2023 21:07:09 +0000 (14:07 -0700)] 
gh-108465: Use compiler basename when determining compiler flags (#108392)

Note:
GNU Autoconf discourages the use of 'basename', and recommends 'expr' instead.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agogh-107801: Document io.TextIOWrapper.tell (#108265)
Erlend E. Aasland [Sun, 27 Aug 2023 20:35:27 +0000 (22:35 +0200)] 
gh-107801: Document io.TextIOWrapper.tell (#108265)

2 years agogh-108542: Fix incorrect module name in NEWS entry for gh-105475 (#108543)
Ori Avtalion [Sun, 27 Aug 2023 19:50:59 +0000 (22:50 +0300)] 
gh-108542: Fix incorrect module name in NEWS entry for gh-105475 (#108543)

2 years agogh-108322: Optimize statistics.NormalDist.samples() (gh-108324)
Raymond Hettinger [Sun, 27 Aug 2023 13:59:40 +0000 (08:59 -0500)] 
gh-108322: Optimize statistics.NormalDist.samples() (gh-108324)

2 years agoClarify distinction between datetime module and class in deprecation messages (GH...
Clément Robert [Sun, 27 Aug 2023 13:09:40 +0000 (15:09 +0200)] 
Clarify distinction between datetime module and class in deprecation messages (GH-108073)

2 years agoFix grammatical error in stringprep documentation (#108414)
Matthew James Kraai [Sun, 27 Aug 2023 11:26:23 +0000 (04:26 -0700)] 
Fix grammatical error in stringprep documentation (#108414)

Remove the word "them", which didn't make grammatical sense.

Co-authored-by: KRAAI, MATTHEW [VISUS] <mkraai@its.jnj.com>
2 years agogh-105052:update timeit function's description (#105060)
R [Sun, 27 Aug 2023 07:22:27 +0000 (15:22 +0800)] 
gh-105052:update timeit function's description (#105060)

---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} (#107486)
qqwqqw689 [Sun, 27 Aug 2023 05:19:49 +0000 (13:19 +0800)] 
gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} (#107486)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agogh-107265: Fix initialize/remove_tools for ENTER_EXECUTOR case (gh-108482)
Dong-hee Na [Sun, 27 Aug 2023 03:31:29 +0000 (12:31 +0900)] 
gh-107265: Fix initialize/remove_tools for ENTER_EXECUTOR case (gh-108482)

2 years agogh-108295: Fix crashes with TypeVar weakrefs (#108517)
Jelle Zijlstra [Sun, 27 Aug 2023 00:13:33 +0000 (17:13 -0700)] 
gh-108295: Fix crashes with TypeVar weakrefs (#108517)

2 years agogh-107913: Fix possible losses of OSError error codes (GH-107930)
Serhiy Storchaka [Sat, 26 Aug 2023 21:35:06 +0000 (00:35 +0300)] 
gh-107913: Fix possible losses of OSError error codes (GH-107930)

Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be
called immediately after using the C API which sets errno or the Windows
error code.

2 years agogh-107406: Add better `struct.Struct` repr (#107407)
denballakh [Sat, 26 Aug 2023 09:54:16 +0000 (14:54 +0500)] 
gh-107406: Add better `struct.Struct` repr (#107407)

2 years agogh-106320: Remove private AC converter functions (#108505)
Victor Stinner [Sat, 26 Aug 2023 02:05:17 +0000 (04:05 +0200)] 
gh-106320: Remove private AC converter functions (#108505)

Move these private functions to the internal C API
(pycore_abstract.h):

* _Py_convert_optional_to_ssize_t()
* _PyNumber_Index()

Argument Clinic now emits #include "pycore_abstract.h" when these
functions are used.

The parser of the c-analyzer tool now uses a list of files which use
the limited C API, rather than a list of files using the internal C
API.

2 years agogh-106320: Remove private _PyLong_FileDescriptor_Converter() (#108503)
Victor Stinner [Sat, 26 Aug 2023 01:18:09 +0000 (03:18 +0200)] 
gh-106320: Remove private _PyLong_FileDescriptor_Converter() (#108503)

Move the private _PyLong converter functions to the internal C API

* _PyLong_FileDescriptor_Converter(): moved to pycore_fileutils.h
* _PyLong_Size_t_Converter(): moved to pycore_long.h

Argument Clinic now emits includes for pycore_fileutils.h and
pycore_long.h when these functions are used.

2 years agogh-106320: Remove private _PyLong converter functions (#108499)
Victor Stinner [Sat, 26 Aug 2023 00:24:27 +0000 (02:24 +0200)] 
gh-106320: Remove private _PyLong converter functions (#108499)

Move these private functions to the internal C API (pycore_long.h):

* _PyLong_UnsignedInt_Converter()
* _PyLong_UnsignedLongLong_Converter()
* _PyLong_UnsignedLong_Converter()
* _PyLong_UnsignedShort_Converter()

Argument Clinic now emits #include "pycore_long.h" when these
functions are used.

2 years agogh-108494: AC supports pos-only args in limited C API (#108498)
Victor Stinner [Fri, 25 Aug 2023 22:39:24 +0000 (00:39 +0200)] 
gh-108494: AC supports pos-only args in limited C API (#108498)

AC now checks for "#define Py_LIMITED_API" pattern to use the limited
C API.

2 years agogh-107603: Argument Clinic can emit includes (#108486)
Victor Stinner [Fri, 25 Aug 2023 22:01:10 +0000 (00:01 +0200)] 
gh-107603: Argument Clinic can emit includes (#108486)

* Add Clinic.add_include() method
* Add CConverter.include and CConverter.add_include()
* Printer.print_block() gets a second parameter: clinic.
* Remove duplicated declaration of "clinic" global variable.

2 years agogh-108494: Argument Clinic partial supports of Limited C API (#108495)
Victor Stinner [Fri, 25 Aug 2023 21:22:08 +0000 (23:22 +0200)] 
gh-108494: Argument Clinic partial supports of Limited C API (#108495)

Argument Clinic now has a partial support of the
Limited API:

* Add --limited option to clinic.c.
* Add '_testclinic_limited' extension which is built with
  the limited C API version 3.13.
* For now, hardcode in clinic.py that "_testclinic_limited.c" targets
  the limited C API.

2 years agoGH-106581: Fix instrumentation in tier 2 (GH-108493)
Brandt Bucher [Fri, 25 Aug 2023 19:12:59 +0000 (12:12 -0700)] 
GH-106581: Fix instrumentation in tier 2 (GH-108493)

2 years agogh-107901: add the HAS_EVAL_BREAK instruction flag (#108375)
Irit Katriel [Fri, 25 Aug 2023 18:33:59 +0000 (19:33 +0100)] 
gh-107901: add the HAS_EVAL_BREAK instruction flag (#108375)

2 years agogh-104504: Cases generator: enable mypy's `possibly-undefined` error code (#108454)
Alex Waygood [Fri, 25 Aug 2023 17:08:29 +0000 (18:08 +0100)] 
gh-104504: Cases generator: enable mypy's `possibly-undefined` error code (#108454)

2 years agogh-102211: Document `re.{Pattern,Match}`’s existence (#102212)
Philipp A [Fri, 25 Aug 2023 16:53:11 +0000 (18:53 +0200)] 
gh-102211: Document `re.{Pattern,Match}`’s existence (#102212)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-108311: Fix test_store_attr_with_hint by disabling optimizer in decorator (#108312)
Guido van Rossum [Fri, 25 Aug 2023 16:40:27 +0000 (09:40 -0700)] 
gh-108311: Fix test_store_attr_with_hint by disabling optimizer in decorator (#108312)

See https://github.com/python/cpython/issues/108311#issuecomment-1693569380

---------

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2 years agogh-107265: Revert "Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR" (#108485)
Dong-hee Na [Fri, 25 Aug 2023 15:23:39 +0000 (00:23 +0900)] 
gh-107265: Revert "Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR" (#108485)

This reverts commit d6ac5c7b105fe57266bd71248e3ada41fedb5ba9.

Reason: the assert we just added could be triggered (see issue).

2 years agogh-108364: Simplify quoting values and identifiers in sqlite3's iterdump() (#108472)
Mariusz Felisiak [Fri, 25 Aug 2023 12:31:52 +0000 (14:31 +0200)] 
gh-108364: Simplify quoting values and identifiers in sqlite3's iterdump() (#108472)

2 years agogh-107932: Fix merge conflict in test_dis (GH-108478)
Mark Shannon [Fri, 25 Aug 2023 12:02:10 +0000 (13:02 +0100)] 
gh-107932: Fix merge conflict in test_dis (GH-108478)

Fix merge conflict in test_dis

2 years agoDocs: Resolve Sphinx warnings in dis.rst (#108476)
Erlend E. Aasland [Fri, 25 Aug 2023 11:28:47 +0000 (13:28 +0200)] 
Docs: Resolve Sphinx warnings in dis.rst (#108476)

- Link to the code objects reference
- Suppress link to deliberately undocumented builtins.__build_class__
- Suppress links for example methods

2 years agoDatamodel: Add headings to the standard type hierarchy (#108146)
Adam Turner [Fri, 25 Aug 2023 11:02:36 +0000 (12:02 +0100)] 
Datamodel: Add headings to the standard type hierarchy (#108146)

Dedent content according to the new layout.

2 years agoDocs: Datamodel: Merge "Notes on using __slots__" with the parent section (#108400)
Adam Turner [Fri, 25 Aug 2023 10:27:36 +0000 (11:27 +0100)] 
Docs: Datamodel: Merge "Notes on using __slots__" with the parent section (#108400)

2 years agogh-108418: Speed up bigmem compression tests in dry mode (GH-108419)
Serhiy Storchaka [Fri, 25 Aug 2023 09:37:27 +0000 (12:37 +0300)] 
gh-108418: Speed up bigmem compression tests in dry mode (GH-108419)

Only generate and compress small amount of random data in dry run.

2 years agogh-108444: Remove _PyLong_AsInt() function (#108461)
Victor Stinner [Fri, 25 Aug 2023 09:13:59 +0000 (11:13 +0200)] 
gh-108444: Remove _PyLong_AsInt() function (#108461)

* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Remove _PyLong_AsInt() alias to PyLong_AsInt().

2 years agogh-107932: Fix dis module for bytecode that does not have an associated source line...
Corvin [Fri, 25 Aug 2023 08:31:26 +0000 (04:31 -0400)] 
gh-107932: Fix dis module for bytecode that does not have an associated source line (GH-107988)

2 years agogh-103384: Generalize the regex pattern `BaseConfigurator.INDEX_PATTERN` to allow...
Peeyush Aggarwal [Fri, 25 Aug 2023 08:15:26 +0000 (13:45 +0530)] 
gh-103384: Generalize the regex pattern `BaseConfigurator.INDEX_PATTERN` to allow spaces and non-alphanumeric characters in keys. (GH-103391)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agoGH-108202: Document ``calendar`` exceptions (#108398)
Adam Turner [Fri, 25 Aug 2023 05:56:54 +0000 (06:56 +0100)] 
GH-108202: Document ``calendar`` exceptions (#108398)

2 years agogh-106581: Split CALL_BOUND_METHOD_EXACT_ARGS into uops (#108462)
Guido van Rossum [Fri, 25 Aug 2023 00:36:00 +0000 (17:36 -0700)] 
gh-106581: Split CALL_BOUND_METHOD_EXACT_ARGS into uops (#108462)

Instead of using `GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS)` we just add the macro elements of the latter to the macro for the former. This requires lengthening the uops array in struct opcode_macro_expansion. (It also required changes to stacking.py that were merged already.)

2 years agogh-106320: Remove private _PyTraceback functions (#108453)
Victor Stinner [Thu, 24 Aug 2023 23:35:47 +0000 (01:35 +0200)] 
gh-106320: Remove private _PyTraceback functions (#108453)

Move private functions to the internal C API (pycore_traceback.h):

* _Py_DisplaySourceLine()
* _PyTraceback_Add()

2 years agogh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460)
Dong-hee Na [Thu, 24 Aug 2023 23:03:26 +0000 (08:03 +0900)] 
gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460)

2 years agogh-108444: Replace _PyLong_AsInt() with PyLong_AsInt() (#108459)
Victor Stinner [Thu, 24 Aug 2023 23:01:30 +0000 (01:01 +0200)] 
gh-108444: Replace _PyLong_AsInt() with PyLong_AsInt() (#108459)

Change generated by the command:

sed -i -e 's!_PyLong_AsInt!PyLong_AsInt!g' \
    $(find -name "*.c" -o -name "*.h")

2 years agogh-108444: Argument Clinic uses PyLong_AsInt() (#108458)
Victor Stinner [Thu, 24 Aug 2023 22:51:22 +0000 (00:51 +0200)] 
gh-108444: Argument Clinic uses PyLong_AsInt() (#108458)

Argument Clinic now uses the new public PyLong_AsInt(), rather than
the old name _PyLong_AsInt().

2 years agoRun `mypy` when `Tools/requirements-dev.txt` changes (#108457)
Nikita Sobolev [Thu, 24 Aug 2023 22:05:23 +0000 (01:05 +0300)] 
Run `mypy` when `Tools/requirements-dev.txt` changes (#108457)

2 years agogh-108444: Add PyLong_AsInt() public function (#108445)
Victor Stinner [Thu, 24 Aug 2023 21:55:30 +0000 (23:55 +0200)] 
gh-108444: Add PyLong_AsInt() public function (#108445)

* Rename _PyLong_AsInt() to PyLong_AsInt().
* Add documentation.
* Add test.
* For now, keep _PyLong_AsInt() as an alias to PyLong_AsInt().

2 years agoGH-103247: bypass the import cache on the _require_loader helper
Filipe Laíns [Thu, 24 Aug 2023 21:05:03 +0000 (22:05 +0100)] 
GH-103247: bypass the import cache on the _require_loader helper

2 years agogh-108447: Detect platform triplets for x86_64 GNU/Hurd (#108045)
Samuel Thibault [Thu, 24 Aug 2023 20:37:20 +0000 (22:37 +0200)] 
gh-108447: Detect platform triplets for x86_64 GNU/Hurd (#108045)

2 years agogh-106320: Remove private _PySys functions (#108452)
Victor Stinner [Thu, 24 Aug 2023 20:02:09 +0000 (22:02 +0200)] 
gh-106320: Remove private _PySys functions (#108452)

Move private functions to the internal C API (pycore_sysmodule.h):

* _PySys_GetAttr()
* _PySys_GetSizeOf()

No longer export most of these functions.

Fix also a typo in Include/cpython/optimizer.h: add a missing space.

2 years agogh-106320: Remove private _PyDict functions (#108449)
Victor Stinner [Thu, 24 Aug 2023 20:01:50 +0000 (22:01 +0200)] 
gh-106320: Remove private _PyDict functions (#108449)

Move private functions to the internal C API (pycore_dict.h):

* _PyDictView_Intersect()
* _PyDictView_New()
* _PyDict_ContainsId()
* _PyDict_DelItemId()
* _PyDict_DelItem_KnownHash()
* _PyDict_GetItemIdWithError()
* _PyDict_GetItem_KnownHash()
* _PyDict_HasSplitTable()
* _PyDict_NewPresized()
* _PyDict_Next()
* _PyDict_Pop()
* _PyDict_SetItemId()
* _PyDict_SetItem_KnownHash()
* _PyDict_SizeOf()

No longer export most of these functions.

Move also the _PyDictViewObject structure to the internal C API.

Move dict_getitem_knownhash() function from _testcapi to the
_testinternalcapi extension. Update test_capi.test_dict for this
change.

2 years agogh-106320: Remove private _PyList functions (#108451)
Victor Stinner [Thu, 24 Aug 2023 19:44:34 +0000 (21:44 +0200)] 
gh-106320: Remove private _PyList functions (#108451)

Move private functions to the internal C API (pycore_list.h):

* _PyList_Extend()
* _PyList_DebugMallocStats()

No longer export these functions.