]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-101100: Fix Sphinx warning in `tutorial/introduction.rst` (#111173) 111183/head
Maciej Olko [Sun, 22 Oct 2023 11:53:17 +0000 (13:53 +0200)] 
gh-101100: Fix Sphinx warning in `tutorial/introduction.rst` (#111173)

2 years agogh-109975: What's new in 3.13: Add PEP 594 to release highlights (#110993)
Hugo van Kemenade [Sun, 22 Oct 2023 07:17:03 +0000 (10:17 +0300)] 
gh-109975: What's new in 3.13: Add PEP 594 to release highlights (#110993)

2 years agogh-111085: Fix invalid state handling in TaskGroup and Timeout (#111111)
Serhiy Storchaka [Sat, 21 Oct 2023 19:18:34 +0000 (22:18 +0300)] 
gh-111085: Fix invalid state handling in TaskGroup and Timeout (#111111)

asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeError
if they are improperly used.

* When they are used without entering the context manager.
* When they are used after finishing.
* When the context manager is entered more than once (simultaneously or
  sequentially).
* If there is no current task when entering the context manager.

They now remain in a consistent state after an exception is thrown,
so subsequent operations can be performed correctly (if they are allowed).

Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
2 years agogh-111159: Fix `doctest` output comparison for exceptions with notes (#111160)
Nikita Sobolev [Sat, 21 Oct 2023 18:02:00 +0000 (21:02 +0300)] 
gh-111159: Fix `doctest` output comparison for exceptions with notes (#111160)

2 years agogh-111157: Mention `__notes__` in `traceback.format_exception_only` docstring (#111158)
Nikita Sobolev [Sat, 21 Oct 2023 15:30:14 +0000 (18:30 +0300)] 
gh-111157: Mention `__notes__` in `traceback.format_exception_only` docstring (#111158)

2 years agogh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919)
Serhiy Storchaka [Sat, 21 Oct 2023 14:44:46 +0000 (17:44 +0300)] 
gh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919)

Test case matching patterns specified by options --match, --ignore,
--matchfile and --ignorefile are now tested in the order of
specification, and the last match determines whether the test case be run
or ignored.

2 years agogh-111123: symtable should visit exception handlers before the else block (#111142)
Irit Katriel [Sat, 21 Oct 2023 12:38:29 +0000 (13:38 +0100)] 
gh-111123: symtable should visit exception handlers before the else block (#111142)

2 years agogh-110572: Fix potential leaks in test_*_code in _testcapi/getargs.c (GH-110573)
Nikita Sobolev [Sat, 21 Oct 2023 12:23:09 +0000 (15:23 +0300)] 
gh-110572: Fix potential leaks in test_*_code in _testcapi/getargs.c (GH-110573)

2 years agogh-111155: Fix direct invocation of test_pprint (GH-111156)
Nikita Sobolev [Sat, 21 Oct 2023 12:09:01 +0000 (15:09 +0300)] 
gh-111155: Fix direct invocation of test_pprint (GH-111156)

2 years agogh-110974: Make sure all test_zoneinfo tests are collected (GH-110975)
Nikita Sobolev [Sat, 21 Oct 2023 11:26:03 +0000 (14:26 +0300)] 
gh-110974: Make sure all test_zoneinfo tests are collected (GH-110975)

Test classes from the test_zoneinfo submodule were overridden by
test classes from the test_zoneinfo_property submodule with the same name.

2 years agogh-110932: Fix regrtest for SOURCE_DATE_EPOCH (#111143)
Victor Stinner [Sat, 21 Oct 2023 08:37:48 +0000 (10:37 +0200)] 
gh-110932: Fix regrtest for SOURCE_DATE_EPOCH (#111143)

If the SOURCE_DATE_EPOCH environment variable is defined, use its
value as the random seed.

2 years agogh-106310 - document the __signature__ attribute (#106311)
Gouvernathor [Fri, 20 Oct 2023 22:54:02 +0000 (00:54 +0200)] 
gh-106310 - document the __signature__ attribute (#106311)

Document the __signature__ attribute

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-111046: for wasi-threads, export memory as well via the linker (GH-111099)
YAMAMOTO Takashi [Fri, 20 Oct 2023 21:54:03 +0000 (06:54 +0900)] 
gh-111046: for wasi-threads, export memory as well via the linker (GH-111099)

2 years agogh-110964: clinic: refactor output_templates() (#110982)
Victor Stinner [Fri, 20 Oct 2023 21:42:02 +0000 (23:42 +0200)] 
gh-110964: clinic: refactor output_templates() (#110982)

2 years agogh-111133: Remove unnecessary PyFrozenSet_Check() calls in const folding (GH-111137)
Kirill Podoprigora [Fri, 20 Oct 2023 20:37:38 +0000 (23:37 +0300)] 
gh-111133: Remove unnecessary PyFrozenSet_Check() calls in const folding (GH-111137)

frozenset does not support multiplication.

2 years agogh-111132: Fix crash on interactive_filename in `run_mod` (#111136)
Nikita Sobolev [Fri, 20 Oct 2023 20:31:26 +0000 (23:31 +0300)] 
gh-111132: Fix crash on interactive_filename in `run_mod` (#111136)

2 years agogh-111089: Use PyUnicode_AsUTF8() in sqlite3 (#111122)
Victor Stinner [Fri, 20 Oct 2023 18:04:27 +0000 (20:04 +0200)] 
gh-111089: Use PyUnicode_AsUTF8() in sqlite3 (#111122)

PyUnicode_AsUTF8() now raises an exception if the string contains
embedded null characters.

2 years agogh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` ...
Nikita Sobolev [Fri, 20 Oct 2023 18:03:32 +0000 (21:03 +0300)] 
gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (#111127)

2 years agogh-111089: PyUnicode_AsUTF8AndSize() sets size on error (#111106)
Victor Stinner [Fri, 20 Oct 2023 18:03:11 +0000 (20:03 +0200)] 
gh-111089: PyUnicode_AsUTF8AndSize() sets size on error (#111106)

On error, PyUnicode_AsUTF8AndSize() now sets the size argument to -1,
to avoid undefined value.

2 years agogh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)
Victor Stinner [Fri, 20 Oct 2023 17:29:27 +0000 (19:29 +0200)] 
gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)

Add PyUnicode_AsUTF8() function to the limited C API.

multiprocessing posixshmem now uses PyUnicode_AsUTF8() instead of
PyUnicode_AsUTF8AndSize(): the extension is built with the limited C
API. The function now raises an exception if the filename contains an
embedded null character instead of truncating silently the filename.

2 years agogh-111119: Fix flaky test test_lock_two_threads (gh-111124)
Sam Gross [Fri, 20 Oct 2023 16:51:34 +0000 (18:51 +0200)] 
gh-111119: Fix flaky test test_lock_two_threads (gh-111124)

2 years agogh-110093: Partially revert previous change in socketmodule.c (GH-111120)
Serhiy Storchaka [Fri, 20 Oct 2023 16:39:45 +0000 (19:39 +0300)] 
gh-110093: Partially revert previous change in socketmodule.c (GH-111120)

2 years agogh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)
Victor Stinner [Fri, 20 Oct 2023 15:59:29 +0000 (17:59 +0200)] 
gh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)

* PyUnicode_AsUTF8() now raises an exception if the string contains
  embedded null characters.
* Update related C API tests (test_capi.test_unicode).
* type_new_set_doc() uses PyUnicode_AsUTF8AndSize() to silently
  truncate doc containing null bytes.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-110093: Replace trivial Py_BuildValue() with direct C API call (GH-110094)
Serhiy Storchaka [Fri, 20 Oct 2023 15:08:41 +0000 (18:08 +0300)] 
gh-110093: Replace trivial Py_BuildValue() with direct C API call (GH-110094)

2 years agoSynchronize test_contextlib with test_contextlib_async (GH-111000)
Serhiy Storchaka [Fri, 20 Oct 2023 14:07:14 +0000 (17:07 +0300)] 
Synchronize test_contextlib with test_contextlib_async (GH-111000)

2 years agogh-110913: Fix WindowsConsoleIO chunking of UTF-8 text (GH-111007)
Tamás Hegedűs [Fri, 20 Oct 2023 11:52:31 +0000 (13:52 +0200)] 
gh-110913: Fix WindowsConsoleIO chunking of UTF-8 text (GH-111007)

2 years agoAdd tests for failing PyUnicode_AsUTF8AndSize() with psize=NULL (GH-111100)
Serhiy Storchaka [Fri, 20 Oct 2023 09:54:00 +0000 (12:54 +0300)] 
Add tests for failing PyUnicode_AsUTF8AndSize() with psize=NULL (GH-111100)

2 years agogh-101100: Fix Sphinx warnings in `library/tty.rst` (#111079)
Hugo van Kemenade [Fri, 20 Oct 2023 04:33:17 +0000 (07:33 +0300)] 
gh-101100: Fix Sphinx warnings in `library/tty.rst` (#111079)

Fix Sphinx warnings in library/tty.rst

2 years agogh-111092: Make turtledemo run without default root enabled (#111093)
Terry Jan Reedy [Fri, 20 Oct 2023 03:58:41 +0000 (23:58 -0400)] 
gh-111092: Make turtledemo run without default root enabled (#111093)

Add missing 'root' argument to PanedWindow call.
Other root children already have it.

2 years agogh-85283: Build posixshmem extension with Limited C API (#111087)
Victor Stinner [Thu, 19 Oct 2023 22:23:49 +0000 (00:23 +0200)] 
gh-85283: Build posixshmem extension with Limited C API (#111087)

Build the _multiprocessing.posixshmem extension with the Limited C
API.

* Add <errno.h> include.
* Replace PyUnicode_AsUTF8() with PyUnicode_AsUTF8AndSize().

2 years agogh-67565: Add tests for C-contiguity checks (GH-110951)
Furkan Onder [Thu, 19 Oct 2023 22:09:57 +0000 (01:09 +0300)] 
gh-67565: Add tests for C-contiguity checks (GH-110951)

2 years agoRemove unnecessary while in SocketIO.readinto (GH-111057)
sc07kvm [Thu, 19 Oct 2023 21:26:30 +0000 (00:26 +0300)] 
Remove unnecessary while in SocketIO.readinto (GH-111057)

It is unnecessary after removing "continue" in 6e6c59b (bpo-42357).

2 years agoadd 3.13 as an option on the bug form (#111083)
Ned Batchelder [Thu, 19 Oct 2023 16:52:56 +0000 (12:52 -0400)] 
add 3.13 as an option on the bug form (#111083)

2 years agogh-109510: Clearly explain "Which Docstrings Are Examined" (#109696)
Unique-Usman [Thu, 19 Oct 2023 15:10:06 +0000 (20:40 +0530)] 
gh-109510: Clearly explain "Which Docstrings Are Examined" (#109696)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agoGH-101100: Fix reference warnings for ``__enter__`` and ``__exit__`` (#110112)
Adam Turner [Thu, 19 Oct 2023 15:05:17 +0000 (16:05 +0100)] 
GH-101100: Fix reference warnings for ``__enter__`` and ``__exit__`` (#110112)

2 years agoGH-101100: Fix reference warnings for ``__getitem__`` (#110118)
Adam Turner [Thu, 19 Oct 2023 15:05:05 +0000 (16:05 +0100)] 
GH-101100: Fix reference warnings for ``__getitem__`` (#110118)

2 years agogh-101100: Fix sphinx warnings in `library/getpass.rst` (#110461)
Nikita Sobolev [Thu, 19 Oct 2023 15:04:29 +0000 (18:04 +0300)] 
gh-101100: Fix sphinx warnings in `library/getpass.rst` (#110461)

2 years agogh-76785: Make interpreters.*Channel Objects Shareable (gh-110607)
Eric Snow [Thu, 19 Oct 2023 14:52:02 +0000 (08:52 -0600)] 
gh-76785: Make interpreters.*Channel Objects Shareable (gh-110607)

This restores their shareability, which was disabled by gh-110318 due to ref leaks.

2 years agogh-76785: Add *Channel.is_closed (gh-110606)
Eric Snow [Thu, 19 Oct 2023 14:51:21 +0000 (08:51 -0600)] 
gh-76785: Add *Channel.is_closed (gh-110606)

2 years agogh-101100: Fix sphinx warnings in `library/codecs.rst` (#110979)
Nikita Sobolev [Thu, 19 Oct 2023 14:20:52 +0000 (17:20 +0300)] 
gh-101100: Fix sphinx warnings in `library/codecs.rst` (#110979)

2 years agogh-111031: Check more files in `test_tokenize` (#111032)
Nikita Sobolev [Thu, 19 Oct 2023 08:29:45 +0000 (11:29 +0300)] 
gh-111031: Check more files in `test_tokenize` (#111032)

2 years agogh-111050: IDLE - Simplify configdialog.HighPage.theme_elements (#111053)
Terry Jan Reedy [Thu, 19 Oct 2023 04:03:24 +0000 (00:03 -0400)] 
gh-111050: IDLE - Simplify configdialog.HighPage.theme_elements (#111053)

Replace tuple value with internal name, removing numbers.
Remove sorting of already ordered dislay names.
Remove '[0]' indexing into now-gone tuple.

2 years agoGH-103082: Clean up the sys.monitoring docs (GH-110532)
Tian Gao [Wed, 18 Oct 2023 23:15:42 +0000 (16:15 -0700)] 
GH-103082: Clean up the sys.monitoring docs (GH-110532)

2 years agoFix a misspelling of Interpeter -> Interpreter (GH-111040)
Nikita Sobolev [Wed, 18 Oct 2023 22:09:45 +0000 (01:09 +0300)] 
Fix a misspelling of Interpeter -> Interpreter (GH-111040)

2 years agoGH-104232: Fix statement about trace return values (GH-110516)
Tian Gao [Wed, 18 Oct 2023 20:24:00 +0000 (13:24 -0700)] 
GH-104232: Fix statement about trace return values (GH-110516)

2 years agoGH-102895 Add an option local_exit in code.interact to block exit() from terminating...
Tian Gao [Wed, 18 Oct 2023 18:36:43 +0000 (11:36 -0700)] 
GH-102895 Add an option local_exit in code.interact to block exit() from terminating the whole process (GH-102896)

2 years agogh-111015: Install IDLE.app and Python Launcher.app on macOS with correct permissions...
Joshua Root [Wed, 18 Oct 2023 13:02:36 +0000 (00:02 +1100)] 
gh-111015: Install IDLE.app and Python Launcher.app on macOS with correct permissions (gh-111016)

Co-authored-by: Ned Deily <nad@python.org>
2 years agogh-100445: Improve error message for unterminated strings with escapes (#100446)
Shantanu [Wed, 18 Oct 2023 12:58:51 +0000 (05:58 -0700)] 
gh-100445: Improve error message for unterminated strings with escapes (#100446)

2 years agogh-103737: IDLE - Remove unneeded .keys() for dict iteration (#110960)
Terry Jan Reedy [Wed, 18 Oct 2023 08:14:52 +0000 (04:14 -0400)] 
gh-103737: IDLE - Remove unneeded .keys() for dict iteration (#110960)

Add comments where .keys() is needed.
Leave debugger usages along because situation is unclear as indicated in expanded comment.
Most testing is manual.

2 years agogh-111019: Align expected and actual titles in test output (#111020)
James [Wed, 18 Oct 2023 07:36:16 +0000 (03:36 -0400)] 
gh-111019: Align expected and actual titles in test output (#111020)

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability

2 years agogh-108747: Add unit tests for site.{usercustomize,sitecustomize} hooks (#109470)
Charles Machalow [Wed, 18 Oct 2023 05:05:41 +0000 (22:05 -0700)] 
gh-108747: Add unit tests for site.{usercustomize,sitecustomize} hooks (#109470)

2 years agogh-110938: More syntax tests for PEP695 funcs and classes (#110986)
Nikita Sobolev [Wed, 18 Oct 2023 05:00:04 +0000 (08:00 +0300)] 
gh-110938: More syntax tests for PEP695 funcs and classes (#110986)

2 years agogh-109975: What's new in 3.13: longer full support (#110997)
Hugo van Kemenade [Wed, 18 Oct 2023 04:42:28 +0000 (07:42 +0300)] 
gh-109975: What's new in 3.13: longer full support (#110997)

2 years agogh-110961: Fixed asyncio.wait docstring to remove deprecated coroutine reference...
Bar Harel [Wed, 18 Oct 2023 04:40:26 +0000 (05:40 +0100)] 
gh-110961: Fixed asyncio.wait docstring to remove deprecated coroutine reference (#111017)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agoRegen Doc/requirements-oldest-sphinx.txt (#111012)
Victor Stinner [Wed, 18 Oct 2023 04:21:35 +0000 (06:21 +0200)] 
Regen Doc/requirements-oldest-sphinx.txt (#111012)

Fix https://github.com/python/cpython/security/dependabot/4: use
urllib3 version 2.0.7.

2 years agogh-76785: Clean Up the Channels Module (gh-110568)
Eric Snow [Tue, 17 Oct 2023 23:51:52 +0000 (17:51 -0600)] 
gh-76785: Clean Up the Channels Module (gh-110568)

2 years agogh-85283: Build _uuid extension with limited C API (#111010)
Victor Stinner [Tue, 17 Oct 2023 23:07:12 +0000 (01:07 +0200)] 
gh-85283: Build _uuid extension with limited C API (#111010)

2 years agogh-84570: Add Timeouts to SendChannel.send() and RecvChannel.recv() (gh-110567)
Eric Snow [Tue, 17 Oct 2023 23:05:49 +0000 (17:05 -0600)] 
gh-84570: Add Timeouts to SendChannel.send() and RecvChannel.recv() (gh-110567)

2 years agogh-85283: Build _scproxy extension with limited C API (#111008)
Victor Stinner [Tue, 17 Oct 2023 22:32:53 +0000 (00:32 +0200)] 
gh-85283: Build _scproxy extension with limited C API (#111008)

* Replace Py_SETREF(v, NULL) with Py_CLEAR(v).
* Reformat the code.

2 years agogh-84570: Send-Wait Fixes for _xxinterpchannels (gh-111006)
Eric Snow [Tue, 17 Oct 2023 22:32:00 +0000 (16:32 -0600)] 
gh-84570: Send-Wait Fixes for _xxinterpchannels (gh-111006)

There were a few things I did in gh-110565 that need to be fixed. I also forgot to add tests in that PR.

(Note that this PR exposes a refleak introduced by gh-110246. I'll take care of that separately.)

2 years agogh-85283: Build resource extension with limited C API (#110989)
Victor Stinner [Tue, 17 Oct 2023 21:52:58 +0000 (23:52 +0200)] 
gh-85283: Build resource extension with limited C API (#110989)

* Replace PyStructSequence_SET_ITEM() with
  PyStructSequence_SetItem().
* Replace PyTuple_GET_SIZE() with PyTuple_Size().
* Replace PyTuple_GET_ITEM() with PyTuple_GetItem().

2 years agogh-85283: Fix _ctypes_test build on Windows in release mode (#111005)
Victor Stinner [Tue, 17 Oct 2023 21:45:24 +0000 (23:45 +0200)] 
gh-85283: Fix _ctypes_test build on Windows in release mode (#111005)

Define Py_BUILD_CORE to not attempt to link the extension to
python3.lib (which fails).

2 years agoAdd `.ruff_cache/` to `.gitignore` (#110983)
Nikita Sobolev [Tue, 17 Oct 2023 20:12:58 +0000 (23:12 +0300)] 
Add `.ruff_cache/` to `.gitignore` (#110983)

2 years agogh-110995: Fix test_gdb check_usable_gdb() (#110998)
Victor Stinner [Tue, 17 Oct 2023 18:19:14 +0000 (20:19 +0200)] 
gh-110995: Fix test_gdb check_usable_gdb() (#110998)

Fix detection of gdb built without Python scripting support.

* check_usable_gdb() doesn't check gdb exit code when calling
  run_gdb().
* Use shutil.which() to get the path to the gdb program.

2 years agogh-109693: Remove pycore_atomic.h (gh-110992)
Donghee Na [Tue, 17 Oct 2023 15:33:50 +0000 (00:33 +0900)] 
gh-109693: Remove pycore_atomic.h (gh-110992)

2 years agogh-85283: Add PySys_Audit() to the limited C API (#108571)
Victor Stinner [Tue, 17 Oct 2023 14:02:23 +0000 (16:02 +0200)] 
gh-85283: Add PySys_Audit() to the limited C API (#108571)

The PySys_Audit() function was added in Python 3.8 by the PEP 578
"Python Runtime Audit Hooks".

Add also PySys_AuditTuple() to the limited C API, function added
to Python 3.13.

Move non-limited "PerfMap" C API from Include/sysmodule.h to
Include/cpython/sysmodule.h.

2 years agogh-85283: Build winsound extension with limited C API (#110978)
Victor Stinner [Tue, 17 Oct 2023 13:57:10 +0000 (15:57 +0200)] 
gh-85283: Build winsound extension with limited C API (#110978)

Replace type->tp_name with PyType_GetQualName().

2 years agogh-107457: update dis documentation with changes in 3.12 (#108900)
Matthieu Dartiailh [Tue, 17 Oct 2023 12:59:34 +0000 (14:59 +0200)] 
gh-107457: update dis documentation with changes in 3.12 (#108900)

2 years agogh-110938: Fix error messages for indented blocks with functions and classes with...
Pablo Galindo Salgado [Tue, 17 Oct 2023 12:45:13 +0000 (13:45 +0100)] 
gh-110938: Fix error messages for indented blocks with functions and classes with generic type parameters (#110973)

2 years agogh-110964: Remove private _PyArg functions (#110966)
Victor Stinner [Tue, 17 Oct 2023 12:30:31 +0000 (14:30 +0200)] 
gh-110964: Remove private _PyArg functions (#110966)

Move the following private functions and structures to
pycore_modsupport.h internal C API:

* _PyArg_BadArgument()
* _PyArg_CheckPositional()
* _PyArg_NoKeywords()
* _PyArg_NoPositional()
* _PyArg_ParseStack()
* _PyArg_ParseStackAndKeywords()
* _PyArg_Parser structure
* _PyArg_UnpackKeywords()
* _PyArg_UnpackKeywordsWithVararg()
* _PyArg_UnpackStack()
* _Py_ANY_VARARGS()

Changes:

* Python/getargs.h now includes pycore_modsupport.h to export
  functions.
* clinic.py now adds pycore_modsupport.h when one of these functions
  is used.
* Add pycore_modsupport.h includes when a C extension uses one of
  these functions.
* Define Py_BUILD_CORE_MODULE in C extensions which now include
  directly or indirectly (via code generated by Argument Clinic)
  pycore_modsupport.h:

  * _csv
  * _curses_panel
  * _dbm
  * _gdbm
  * _multiprocessing.posixshmem
  * _sqlite.row
  * _statistics
  * grp
  * resource
  * syslog

* _testcapi: bad_get() no longer uses METH_FASTCALL calling
  convention but METH_VARARGS. Replace _PyArg_UnpackStack() with
  PyArg_ParseTuple().
* _testcapi: add PYTESTCAPI_NEED_INTERNAL_API macro which is defined
  by _testcapi sub-modules which need the internal C API
  (pycore_modsupport.h): exceptions.c, float.c, vectorcall.c,
  watchers.c.
* Remove Include/cpython/modsupport.h header file.
  Include/modsupport.h no longer includes the removed header file.
* Fix mypy clinic.py

2 years agogh-85283: Fix Argument Clinic for md5 extension (#110976)
Victor Stinner [Tue, 17 Oct 2023 11:46:16 +0000 (13:46 +0200)] 
gh-85283: Fix Argument Clinic for md5 extension (#110976)

Limited C API supports the defining class under some conditions.

2 years agogh-85283: Build md5 extension with limited C API (#110967)
Victor Stinner [Tue, 17 Oct 2023 10:57:41 +0000 (12:57 +0200)] 
gh-85283: Build md5 extension with limited C API (#110967)

* Replace _Py_strhex() with few lines of code.
* Replace _PyType_GetModuleState() with PyType_GetModuleState().
* Fix make check-c-globals.

2 years agoBump test deps: `ruff` and `pre-commit-hooks` (#110972)
Nikita Sobolev [Tue, 17 Oct 2023 10:32:29 +0000 (13:32 +0300)] 
Bump test deps: `ruff` and `pre-commit-hooks` (#110972)

2 years agogh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED new in 3.13. (#110969)
Victor Stinner [Tue, 17 Oct 2023 10:27:16 +0000 (12:27 +0200)] 
gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED new in 3.13. (#110969)

* Only add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED to limited C API
  version 3.13.
* errno, xxlimited and _ctypes_test extensions now need the limited C
  API version 3.13 to get Py_MOD_PER_INTERPRETER_GIL_SUPPORTED.  They
  now include standard header files explicitly: <errno.h>, <string.h>
  and <stdio.h>.
* xxlimited_35: Remove Py_mod_multiple_interpreters slot,
  incompatible with limited C API version 3.5.

2 years agogh-110695: test_asyncio uses 50 ms for clock resolution (#110952)
Victor Stinner [Tue, 17 Oct 2023 09:34:04 +0000 (11:34 +0200)] 
gh-110695: test_asyncio uses 50 ms for clock resolution (#110952)

Before utils.CLOCK_RES constant was added (20 ms), test_asyncio
already used 50 ms.

2 years agoBump sphinx-lint to v0.8.1 (#110933)
Alex Waygood [Tue, 17 Oct 2023 05:26:06 +0000 (06:26 +0100)] 
Bump sphinx-lint to v0.8.1 (#110933)

2 years agogh-85283: Build errno and _ctypes_test with limited C API (#110955)
Victor Stinner [Tue, 17 Oct 2023 01:05:20 +0000 (03:05 +0200)] 
gh-85283: Build errno and _ctypes_test with limited C API (#110955)

_testimportmultiple is now built with limited C API version 3.2.

2 years agogh-85283: Add PyMem_RawMalloc() to the limited C API (#108570)
Victor Stinner [Tue, 17 Oct 2023 00:41:51 +0000 (02:41 +0200)] 
gh-85283: Add PyMem_RawMalloc() to the limited C API (#108570)

Add PyMem_RawMalloc(), PyMem_RawCalloc(), PyMem_RawRealloc() and
PyMem_RawFree() to the limited C API.

These functions were added by Python 3.4 and are needed to port
stdlib extensions to the limited C API, like grp and pwd.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years agogh-85283: Build _testimportmultiple with limited C API (#110954)
Victor Stinner [Tue, 17 Oct 2023 00:27:15 +0000 (02:27 +0200)] 
gh-85283: Build _testimportmultiple with limited C API (#110954)

2 years agogh-109693: Update _gil_runtime_state.locked to use pyatomic.h (gh-110836)
Donghee Na [Mon, 16 Oct 2023 22:32:50 +0000 (07:32 +0900)] 
gh-109693: Update _gil_runtime_state.locked to use pyatomic.h (gh-110836)

2 years agogh-84570: Factor Out _channel_send_wait() (gh-110949)
Eric Snow [Mon, 16 Oct 2023 21:42:57 +0000 (15:42 -0600)] 
gh-84570: Factor Out _channel_send_wait() (gh-110949)

This makes several subsequent changes cleaner.

2 years agogh-107450: Remove unnecessary overflow check in parser error handler (#110940)
Lysandros Nikolaou [Mon, 16 Oct 2023 20:41:01 +0000 (22:41 +0200)] 
gh-107450: Remove unnecessary overflow check in parser error handler (#110940)

2 years agogh-110905: [Enum] minor fixes and cleanup (GH-110906)
Pieter Eendebak [Mon, 16 Oct 2023 20:37:54 +0000 (22:37 +0200)] 
gh-110905: [Enum] minor fixes and cleanup (GH-110906)

2 years agoC-API docs: Clarify the size of arenas (#110895)
Mienxiu [Mon, 16 Oct 2023 18:52:13 +0000 (03:52 +0900)] 
C-API docs: Clarify the size of arenas (#110895)

Clarify the size of arenas

From 3.10.0 alpha 7, the pymalloc allocator uses arenas with a fixed size of 1
MiB on 64-bit platforms instead of 256 KiB on 32-bit platforms.

2 years agogh-110864: TypeVar constructor: Partially revert gh-110784, `constraints` cannot...
Nikita Sobolev [Mon, 16 Oct 2023 15:01:04 +0000 (18:01 +0300)] 
gh-110864: TypeVar constructor: Partially revert gh-110784, `constraints` cannot be `NULL` (#110922)

2 years agoEnable ruff on several more files in `Lib/test` (#110929)
Alex Waygood [Mon, 16 Oct 2023 14:57:01 +0000 (15:57 +0100)] 
Enable ruff on several more files in `Lib/test` (#110929)

2 years agogh-107450: Check for overflow in the tokenizer and fix overflow test (#110832)
Lysandros Nikolaou [Mon, 16 Oct 2023 14:42:49 +0000 (16:42 +0200)] 
gh-107450: Check for overflow in the tokenizer and fix overflow test (#110832)

Co-authored-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-110912: Correctly display tracebacks for MemoryError exceptions using the tracebac...
Pablo Galindo Salgado [Mon, 16 Oct 2023 14:39:23 +0000 (15:39 +0100)] 
gh-110912: Correctly display tracebacks for MemoryError exceptions using the traceback module (#110921)

2 years agogh-110907: AC: Disallow using `*` with vararg (#110908)
Nikita Sobolev [Mon, 16 Oct 2023 14:26:11 +0000 (17:26 +0300)] 
gh-110907: AC: Disallow using `*` with vararg (#110908)

2 years agogh-110923: Fix silently skipped tests in test__opcode.py (#110926)
Alex Waygood [Mon, 16 Oct 2023 13:30:35 +0000 (14:30 +0100)] 
gh-110923: Fix silently skipped tests in test__opcode.py (#110926)

2 years agogh-110527: Improve `PySet_Clear` docs (#110528)
Nikita Sobolev [Mon, 16 Oct 2023 13:05:09 +0000 (16:05 +0300)] 
gh-110527: Improve `PySet_Clear` docs (#110528)

2 years agogh-110864: Fix _PyArg_UnpackKeywordsWithVararg overwriting vararg with NULL (#110868)
Nikita Sobolev [Mon, 16 Oct 2023 11:42:44 +0000 (14:42 +0300)] 
gh-110864: Fix _PyArg_UnpackKeywordsWithVararg overwriting vararg with NULL (#110868)

2 years agosysconfig docs: fix broken link to the source code (#110920)
Karolina Surma [Mon, 16 Oct 2023 11:27:12 +0000 (13:27 +0200)] 
sysconfig docs: fix broken link to the source code (#110920)

It's now a package. See: https://github.com/python/cpython/commit/4a53a397c311567f05553bc25a28aebaba4f6f65

2 years agogh-108791: Fix `pdb` CLI invalid argument handling (#108816)
Radislav Chugunov [Mon, 16 Oct 2023 09:38:07 +0000 (12:38 +0300)] 
gh-108791: Fix `pdb` CLI invalid argument handling (#108816)

2 years agoregrtest: Prepend 'use' options in --{fast,slow}-ci (GH-110363)
Zachary Ware [Sun, 15 Oct 2023 18:34:28 +0000 (13:34 -0500)] 
regrtest: Prepend 'use' options in --{fast,slow}-ci (GH-110363)

This allows individual resources to be disabled without having to explicitly re-enable all others.

2 years agogh-110886 Doc: add a link to BNF Wikipedia article (#110887)
partev [Sun, 15 Oct 2023 16:52:13 +0000 (12:52 -0400)] 
gh-110886 Doc: add a link to BNF Wikipedia article (#110887)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoLint: Include test_monitoring.py for Ruff (#110898)
Hugo van Kemenade [Sun, 15 Oct 2023 16:48:00 +0000 (19:48 +0300)] 
Lint: Include test_monitoring.py for Ruff (#110898)

2 years agogh-84583: Make pdb enter post-mortem mode even for SyntaxError (#110883)
Tian Gao [Sun, 15 Oct 2023 10:55:00 +0000 (03:55 -0700)] 
gh-84583: Make pdb enter post-mortem mode even for SyntaxError (#110883)

2 years agogh-110722: Add PYTHON_PRESITE to import a module before site.py is run (#110769)
Łukasz Langa [Sat, 14 Oct 2023 21:32:57 +0000 (23:32 +0200)] 
gh-110722: Add PYTHON_PRESITE to import a module before site.py is run (#110769)

2 years agobpo-42663: Fix parsing TZ strings in zoneinfo module (GH-23825)
Serhiy Storchaka [Sat, 14 Oct 2023 20:24:33 +0000 (23:24 +0300)] 
bpo-42663: Fix parsing TZ strings in zoneinfo module (GH-23825)

zipinfo now supports the full range of values in the TZ string
determined by RFC 8536 and detects all invalid formats.
Both Python and C implementations now raise exceptions of the same
type on invalid data.