]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agotyping docs: Make the PEPs list an expandable section, hidden by default (#105353)
Alex Waygood [Wed, 7 Jun 2023 06:37:02 +0000 (07:37 +0100)] 
typing docs: Make the PEPs list an expandable section, hidden by default (#105353)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoGH-95088: Clarify rules for parsing an item key for format strings (#103779)
achhina [Wed, 7 Jun 2023 02:01:36 +0000 (22:01 -0400)] 
GH-95088: Clarify rules for parsing an item key for format strings (#103779)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years agogh-105286: Further improvements to `typing.py` docstrings (#105363)
Alex Waygood [Wed, 7 Jun 2023 00:21:16 +0000 (01:21 +0100)] 
gh-105286: Further improvements to `typing.py` docstrings (#105363)

2 years ago`typing.NewType` docs: the future performance improvements are now in the past (...
Alex Waygood [Wed, 7 Jun 2023 00:18:09 +0000 (01:18 +0100)] 
`typing.NewType` docs: the future performance improvements are now in the past (#105354)

2 years agoGH-102613: Fast recursive globbing in `pathlib.Path.glob()` (GH-104512)
Barney Gale [Tue, 6 Jun 2023 22:50:36 +0000 (23:50 +0100)] 
GH-102613: Fast recursive globbing in `pathlib.Path.glob()` (GH-104512)

This commit introduces a 'walk-and-match' strategy for handling glob patterns that include a non-terminal `**` wildcard, such as `**/*.py`. For this example, the previous implementation recursively walked directories using `os.scandir()` when it expanded the `**` component, and then **scanned those same directories again** when expanded the `*.py` component. This is wasteful.

In the new implementation, any components following a `**` wildcard are used to build a `re.Pattern` object, which is used to filter the results of the recursive walk. A pattern like `**/*.py` uses half the number of `os.scandir()` calls; a pattern like `**/*/*.py` a third, etc.

This new algorithm does not apply if either:

1. The *follow_symlinks* argument is set to `None` (its default), or
2. The pattern contains `..` components.

In these cases we fall back to the old implementation.

This commit also replaces selector classes with selector functions. These generators directly yield results rather calling through to their successors. A new internal `Path._glob()` method takes care to chain these generators together, which simplifies the lazy algorithm and slightly improves performance. It should also be easier to understand and maintain.

2 years agogh-105382: Remove urllib.request cafile parameter (#105384)
Victor Stinner [Tue, 6 Jun 2023 21:17:45 +0000 (23:17 +0200)] 
gh-105382: Remove urllib.request cafile parameter (#105384)

Remove cafile, capath and cadefault parameters of the
urllib.request.urlopen() function, deprecated in Python 3.6.

2 years agogh-105407: Remove unused imports in the stdlib (#105411)
Victor Stinner [Tue, 6 Jun 2023 21:13:24 +0000 (23:13 +0200)] 
gh-105407: Remove unused imports in the stdlib (#105411)

2 years agogh-105407: Remove unused imports in Tools/c-analyzer/ (#105410)
Victor Stinner [Tue, 6 Jun 2023 21:08:48 +0000 (23:08 +0200)] 
gh-105407: Remove unused imports in Tools/c-analyzer/ (#105410)

2 years agogh-105407: Remove unused imports in tools (#105409)
Victor Stinner [Tue, 6 Jun 2023 20:51:26 +0000 (22:51 +0200)] 
gh-105407: Remove unused imports in tools (#105409)

2 years agogh-105407: Remove unused imports in tests (#105408)
Victor Stinner [Tue, 6 Jun 2023 20:50:43 +0000 (22:50 +0200)] 
gh-105407: Remove unused imports in tests (#105408)

2 years agogh-82180: Update math.factorial(float) doc for Python 3.10 (#105385)
Victor Stinner [Tue, 6 Jun 2023 19:47:57 +0000 (21:47 +0200)] 
gh-82180: Update math.factorial(float) doc for Python 3.10 (#105385)

2 years agogh-105373: Fix decimal documentation formatting (#105395)
Victor Stinner [Tue, 6 Jun 2023 19:43:35 +0000 (21:43 +0200)] 
gh-105373: Fix decimal documentation formatting (#105395)

The deprecation is on decimal.HAVE_THREADS, not on the whole module.

2 years agosliding_window() recipe: Raise ValueError for non-positive window sizes. Add more...
Raymond Hettinger [Tue, 6 Jun 2023 18:44:45 +0000 (13:44 -0500)] 
sliding_window() recipe:  Raise ValueError for non-positive window sizes.  Add more tests. (GH-105403)

2 years agogh-105376: Remove logging.Logger.warn() method (#105377)
Victor Stinner [Tue, 6 Jun 2023 18:35:51 +0000 (20:35 +0200)] 
gh-105376: Remove logging.Logger.warn() method (#105377)

2 years agogh-104783: locale.getlocale() calls sys.getfilesystemencoding() (#105401)
Victor Stinner [Tue, 6 Jun 2023 18:19:40 +0000 (20:19 +0200)] 
gh-104783: locale.getlocale() calls sys.getfilesystemencoding() (#105401)

locale.getlocale() always calls sys.getfilesystemencoding(), instead
of calling it only once.

2 years agogh-94172: Update keyfile removal documentation (#105392)
Victor Stinner [Tue, 6 Jun 2023 18:14:06 +0000 (20:14 +0200)] 
gh-94172: Update keyfile removal documentation (#105392)

Remove the "deprecated:: 3.6" markup, since the parameters (like
keyfile and certfile) got removed in Python 3.12.

2 years agogh-92658: Fix typo in docs and tests for `HV_GUID_PARENT` (GH-105267)
Nikita Sobolev [Tue, 6 Jun 2023 16:11:19 +0000 (19:11 +0300)] 
gh-92658: Fix typo in docs and tests for `HV_GUID_PARENT` (GH-105267)

2 years agogh-104783: locale.getencoding() fallback uses FS encoding (#105381)
Victor Stinner [Tue, 6 Jun 2023 14:55:21 +0000 (16:55 +0200)] 
gh-104783: locale.getencoding() fallback uses FS encoding (#105381)

The locale.getencoding() function now uses
sys.getfilesystemencoding() if _locale.getencoding() is missing,
instead of calling locale.getdefaultlocale().

2 years agogh-102304: Document Py_INCREF() change in What's New in Python 3.12 (#105389)
Victor Stinner [Tue, 6 Jun 2023 14:50:58 +0000 (16:50 +0200)] 
gh-102304: Document Py_INCREF() change in What's New in Python 3.12 (#105389)

Not in Python 3.13.

2 years agogh-105156: Update Unicode C API: remove deprecation (#105379)
Victor Stinner [Tue, 6 Jun 2023 14:42:49 +0000 (16:42 +0200)] 
gh-105156: Update Unicode C API: remove deprecation (#105379)

_PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(),
_PyUnicode_ToTitlecase() are no longer deprecated in the
documentation. It's no longer needed since they now use Py_UCS4 type,
rather than the deprecated Py_UNICODE type.

2 years agogh-104783: Remove locale.resetlocale() function (#104784)
Victor Stinner [Tue, 6 Jun 2023 12:55:50 +0000 (14:55 +0200)] 
gh-104783: Remove locale.resetlocale() function (#104784)

2 years agogh-105268: Add _Py_FROM_GC() function to pycore_gc.h (#105362)
Victor Stinner [Tue, 6 Jun 2023 12:44:48 +0000 (14:44 +0200)] 
gh-105268: Add _Py_FROM_GC() function to pycore_gc.h (#105362)

* gcmodule.c reuses _Py_AS_GC(op) for AS_GC()
* Move gcmodule.c FROM_GC() implementation to a new _Py_FROM_GC()
  static inline function in pycore_gc.h.
* _PyObject_IS_GC(): only get the type once
* gc_is_finalized(à) and PyObject_GC_IsFinalized() use
  _PyGC_FINALIZED(), instead of _PyGCHead_FINALIZED().
* Remove _Py_CAST() in pycore_gc.h: this header file is not built
  with C++.

2 years agobuild(deps): bump requests from 2.29.0 to 2.31.0 in /Doc (#105368)
dependabot[bot] [Tue, 6 Jun 2023 12:35:51 +0000 (14:35 +0200)] 
build(deps): bump requests from 2.29.0 to 2.31.0 in /Doc (#105368)

Bumps [requests](https://github.com/psf/requests) from 2.29.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.29.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years agogh-105259: Ensure we don't show newline characters for trailing NEWLINE tokens (...
Pablo Galindo Salgado [Tue, 6 Jun 2023 11:52:16 +0000 (13:52 +0200)] 
gh-105259: Ensure we don't show newline characters for trailing NEWLINE tokens (#105364)

2 years agogh-102304: Fix up Simple ABI doc (GH-105351)
Victor Stinner [Tue, 6 Jun 2023 11:03:51 +0000 (13:03 +0200)] 
gh-102304: Fix up Simple ABI doc (GH-105351)

2 years agogh-104411: Update test_getint for Tcl 9.0 (GH-104412)
Christopher Chavez [Tue, 6 Jun 2023 10:01:22 +0000 (05:01 -0500)] 
gh-104411: Update test_getint for Tcl 9.0 (GH-104412)

2 years agogh-105268: Remove _PyGC_FINALIZED() macro (#105350)
Victor Stinner [Tue, 6 Jun 2023 09:54:23 +0000 (11:54 +0200)] 
gh-105268: Remove _PyGC_FINALIZED() macro (#105350)

Remove the old private, undocumented and untested _PyGC_FINALIZED()
macro which was kept for backward compatibility with Python 3.8 and
older.

2 years agoAdd myself as codeowner for Limited API/Stable ABI, remove from *import* (GH-105349)
Petr Viktorin [Tue, 6 Jun 2023 09:33:40 +0000 (11:33 +0200)] 
Add myself as codeowner for Limited API/Stable ABI, remove from *import* (GH-105349)

This should set up more relevant notifications for me.

2 years agogh-90005: Don't link with libbsd if not needed (#105236)
Erlend E. Aasland [Tue, 6 Jun 2023 09:33:01 +0000 (11:33 +0200)] 
gh-90005: Don't link with libbsd if not needed (#105236)

The regression was introduced with commit 5b946cada.
Restore pre gh-29696 behaviour.

2 years agogh-105292: Add option to make traceback.TracebackException.format_exception_only...
Irit Katriel [Tue, 6 Jun 2023 09:26:18 +0000 (10:26 +0100)] 
gh-105292: Add option to make traceback.TracebackException.format_exception_only recurse into exception groups (#105294)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agogh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763)
Victor Stinner [Tue, 6 Jun 2023 09:15:09 +0000 (11:15 +0200)] 
gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763)

When Python is built in debug mode (if the Py_REF_DEBUG macro is
defined), the Py_INCREF() and Py_DECREF() function are now always
implemented as opaque functions to avoid leaking implementation
details like the "_Py_RefTotal" variable or the
_Py_DecRefTotal_DO_NOT_USE_THIS() function.

* Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and
  _Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI.
* Remove _Py_NegativeRefcount() from limited C API.

2 years agogh-102304: doc: Add links to Stable ABI and Limited C API (#105345)
Victor Stinner [Tue, 6 Jun 2023 08:40:32 +0000 (10:40 +0200)] 
gh-102304: doc: Add links to Stable ABI and Limited C API (#105345)

* Add "limited-c-api" and "stable-api" references.
* Rename "stable-abi-list" reference to "limited-api-list".
* Makefile: Document files regenerated by "make regen-limited-abi"
* Remove first empty line in generated files:

  - Lib/test/test_stable_abi_ctypes.py
  - PC/python3dll.c

2 years agogh-104399: Use newer libtommath APIs when necessary (GH-104407)
Christopher Chavez [Tue, 6 Jun 2023 06:52:07 +0000 (01:52 -0500)] 
gh-104399: Use newer libtommath APIs when necessary (GH-104407)

2 years agoDisplay the sanitizer config in the regrtest header. (#105301)
Gregory P. Smith [Tue, 6 Jun 2023 06:36:36 +0000 (23:36 -0700)] 
Display the sanitizer config in the regrtest header. (#105301)

Display the sanitizers present in libregrtest.

Having this in the CI output for tests with the relevant environment
variable displayed will help make it easier to do what we need to
create an equivalent local test run.

2 years agogh-105324: Fix tokenize module main function for stdin (#105325)
Pablo Galindo Salgado [Mon, 5 Jun 2023 16:36:40 +0000 (18:36 +0200)] 
gh-105324: Fix tokenize module main function for stdin (#105325)

2 years agoRemove dead code in codeop.py (#105263)
Tian Gao [Mon, 5 Jun 2023 16:14:10 +0000 (09:14 -0700)] 
Remove dead code in codeop.py (#105263)

2 years agogh-89412: Add missing attributes (added in 3.10) to traceback module docs (#105046)
Jakub Kuczys [Mon, 5 Jun 2023 16:10:13 +0000 (18:10 +0200)] 
gh-89412: Add missing attributes (added in 3.10) to traceback module docs (#105046)

2 years agoWhat's New in 3.12: List 'Improved Modules' alphabetically (#105315)
Hugo van Kemenade [Mon, 5 Jun 2023 15:04:11 +0000 (18:04 +0300)] 
What's New in 3.12: List 'Improved Modules' alphabetically (#105315)

2 years agogh-105286: Improve `typing.py` docstrings (#105287)
Alex Waygood [Mon, 5 Jun 2023 14:16:09 +0000 (15:16 +0100)] 
gh-105286: Improve `typing.py` docstrings (#105287)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years agogh-105280: Ensure `isinstance([], collections.abc.Mapping)` always evaluates to ...
Alex Waygood [Mon, 5 Jun 2023 14:10:49 +0000 (15:10 +0100)] 
gh-105280: Ensure `isinstance([], collections.abc.Mapping)` always evaluates to `False` (#105281)

2 years agogh-103906: Remove immortal refcounting in compile/marshal.c (gh-103922)
Dong-hee Na [Mon, 5 Jun 2023 13:38:36 +0000 (22:38 +0900)] 
gh-103906: Remove immortal refcounting in compile/marshal.c (gh-103922)

2 years agogh-105237: Allow calling `issubclass(X, typing.Protocol)` again (#105239)
Alex Waygood [Mon, 5 Jun 2023 13:36:51 +0000 (14:36 +0100)] 
gh-105237: Allow calling `issubclass(X, typing.Protocol)` again (#105239)

2 years agogh-105164: Detect annotations inside match blocks (#105177)
Jelle Zijlstra [Mon, 5 Jun 2023 13:07:17 +0000 (06:07 -0700)] 
gh-105164: Detect annotations inside match blocks (#105177)

2 years agoGH-105229: Replace some superinstructions with single instruction equivalent. (GH...
Mark Shannon [Mon, 5 Jun 2023 10:07:04 +0000 (11:07 +0100)] 
GH-105229: Replace some superinstructions with single instruction equivalent. (GH-105230)

2 years agoGH-104584: Allow optimizers to opt out of optimizing. (GH-105244)
Mark Shannon [Mon, 5 Jun 2023 08:44:23 +0000 (09:44 +0100)] 
GH-104584: Allow optimizers to opt out of optimizing. (GH-105244)

2 years agogh-103558: Add coverage tests for argparse (#103570)
Tian Gao [Mon, 5 Jun 2023 07:14:00 +0000 (00:14 -0700)] 
gh-103558: Add coverage tests for argparse (#103570)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2 years agogh-98963: Restore the ability to have a dict-less property. (#105262)
Gregory P. Smith [Mon, 5 Jun 2023 03:18:15 +0000 (20:18 -0700)] 
gh-98963: Restore the ability to have a dict-less property. (#105262)

Ignore doc string assignment failures in `property` as has been the
behavior of all past Python releases.

2 years agogh-80480: array: Add 'w' typecode. (#105242)
Inada Naoki [Sun, 4 Jun 2023 16:45:00 +0000 (01:45 +0900)] 
gh-80480: array: Add 'w' typecode. (#105242)

2 years agogh-104882: Docs: fix description of relationship between `socket.getblocking()` and...
Joe Geisbauer [Sun, 4 Jun 2023 15:59:16 +0000 (10:59 -0500)] 
gh-104882: Docs: fix description of relationship between `socket.getblocking()` and `socket.gettimeout()` (#105026)

2 years agoFix typo in Python 3.12 What's New (#105278)
Shantanu [Sun, 4 Jun 2023 15:42:00 +0000 (08:42 -0700)] 
Fix typo in Python 3.12 What's New (#105278)

2 years agogh-104690 Disallow thread creation and fork at interpreter finalization (#104826)
chgnrdv [Sun, 4 Jun 2023 04:06:45 +0000 (07:06 +0300)] 
gh-104690 Disallow thread creation and fork at interpreter finalization (#104826)

Disallow thread creation and fork at interpreter finalization.

in the following functions, check if interpreter is finalizing and raise `RuntimeError` with appropriate message:
* `_thread.start_new_thread` and thus `threading`
* `posix.fork`
* `posix.fork1`
* `posix.forkpty`
* `_posixsubprocess.fork_exec` when a `preexec_fn=` is supplied.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-89415: Mention new `IP_*` constants in `socket` module in the docs (#105266)
Nikita Sobolev [Sat, 3 Jun 2023 15:28:29 +0000 (18:28 +0300)] 
gh-89415: Mention new `IP_*` constants in `socket` module in the docs (#105266)

2 years agogh-103277: remove unused macros (#105247)
Irit Katriel [Sat, 3 Jun 2023 11:12:07 +0000 (12:12 +0100)] 
gh-103277: remove unused macros (#105247)

2 years agogh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258)
Eric Snow [Fri, 2 Jun 2023 22:52:33 +0000 (16:52 -0600)] 
gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258)

The _xxsubinterpreters module was meant to only use public API.  Some internal C-API usage snuck in over the last few years (e.g. gh-28969).  This fixes that.

2 years agogh-105080: Fixed inconsistent signature on derived classes (#105217)
Tian Gao [Fri, 2 Jun 2023 22:22:33 +0000 (06:22 +0800)] 
gh-105080: Fixed inconsistent signature on derived classes (#105217)

2 years agoGH-102404, GH-100956: Document how to do a WASI build (GH-105251)
Brett Cannon [Fri, 2 Jun 2023 22:15:41 +0000 (15:15 -0700)] 
GH-102404, GH-100956: Document how to do a WASI build (GH-105251)

Also includes a reference shell script to implements what is documented.

2 years agogh-104614: Fix potential ref. leak in _testcapimodule/get_basic_static_type() (#105225)
Erlend E. Aasland [Fri, 2 Jun 2023 16:44:24 +0000 (18:44 +0200)] 
gh-104614: Fix potential ref. leak in _testcapimodule/get_basic_static_type() (#105225)

2 years agogh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding...
Irit Katriel [Fri, 2 Jun 2023 16:01:46 +0000 (17:01 +0100)] 
gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (#105190)

2 years agogh-87092: avoid gcc warning on uninitialized struct field in assemble… (gh-105243)
Dong-hee Na [Fri, 2 Jun 2023 16:00:50 +0000 (01:00 +0900)] 
gh-87092: avoid gcc warning on uninitialized struct field in assemble… (gh-105243)

gh-87092: avoid gcc warning on uninitialized struct field in assemble.c (part2)

2 years agogh-105240: add missing function prototypes (#105241)
Irit Katriel [Fri, 2 Jun 2023 15:11:20 +0000 (16:11 +0100)] 
gh-105240: add missing function prototypes (#105241)

2 years agogh-105214: Use named constants for MAKE_FUNCTION oparg (#105215)
Jelle Zijlstra [Fri, 2 Jun 2023 14:10:45 +0000 (07:10 -0700)] 
gh-105214: Use named constants for MAKE_FUNCTION oparg (#105215)

2 years agogh-105194: Fix format specifier escaped characters in f-strings (#105231)
Pablo Galindo Salgado [Fri, 2 Jun 2023 11:33:26 +0000 (13:33 +0200)] 
gh-105194: Fix format specifier escaped characters in f-strings (#105231)

2 years agoGH-104584: Plugin optimizer API (GH-105100)
Mark Shannon [Fri, 2 Jun 2023 10:46:18 +0000 (11:46 +0100)] 
GH-104584: Plugin optimizer API (GH-105100)

2 years agoGH-105162: Account for `INSTRUMENTED_RESUME` in gen.close/throw. (GH-105187)
Mark Shannon [Fri, 2 Jun 2023 09:39:38 +0000 (10:39 +0100)] 
GH-105162: Account for `INSTRUMENTED_RESUME` in gen.close/throw. (GH-105187)

2 years agogh-105184: document that marshal functions can fail and need to be checked with PyErr...
Irit Katriel [Fri, 2 Jun 2023 07:59:18 +0000 (08:59 +0100)] 
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (#105185)

2 years agogh-104799: Default missing lists in AST to the empty list (#104834)
Jelle Zijlstra [Fri, 2 Jun 2023 01:39:39 +0000 (18:39 -0700)] 
gh-104799: Default missing lists in AST to the empty list (#104834)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-85275: Remove old buffer APIs (#105137)
Inada Naoki [Fri, 2 Jun 2023 01:12:40 +0000 (10:12 +0900)] 
gh-85275: Remove old buffer APIs (#105137)

They are now abi-only.

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-92536: Remove PyUnicode_READY() calls (#105210)
Victor Stinner [Thu, 1 Jun 2023 23:33:17 +0000 (01:33 +0200)] 
gh-92536: Remove PyUnicode_READY() calls (#105210)

Since Python 3.12, PyUnicode_READY() does nothing and always
returns 0.

2 years agogh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)
Victor Stinner [Thu, 1 Jun 2023 23:31:58 +0000 (01:31 +0200)] 
gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)

Since Python 3.12, PyUnicode_READY() does nothing and always
returns 0.

Argument Clinic now also checks for .cpp files (PC/_wmimodule.cpp).

2 years agogh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122)
Eric Snow [Thu, 1 Jun 2023 22:28:31 +0000 (16:28 -0600)] 
gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122)

When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary).  That led to problems for third-party static types.

We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.

2 years agogh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current Thread...
Eric Snow [Thu, 1 Jun 2023 22:24:10 +0000 (16:24 -0600)] 
gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current Thread (gh-105109)

This avoids the problematic race in drop_gil() by skipping the FORCE_SWITCHING code there for finalizing threads.

(The idea for this approach came out of discussions with @markshannon.)

2 years agoGH-89886: Bump to GNU Autoconf v2.71 (#104925)
Erlend E. Aasland [Thu, 1 Jun 2023 21:44:25 +0000 (23:44 +0200)] 
GH-89886: Bump to GNU Autoconf v2.71 (#104925)

Co-authored-by: Christian Heimes <christian@python.org>
2 years agogh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)
Irit Katriel [Thu, 1 Jun 2023 20:57:28 +0000 (21:57 +0100)] 
gh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)

2 years agogh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174)
Gregory P. Smith [Thu, 1 Jun 2023 16:42:18 +0000 (09:42 -0700)] 
gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174)

Upgrade builds to OpenSSL 1.1.1u.

This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t.

The Mac/BuildScript/build-installer.py was already updated.

Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9, and adds a new _ssl_data_31.h file from 3.1.1 along with the ssl.c code to use it.

Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting).

backports of this prior to 3.12 will not include the openssl 3.1 header.

2 years agogh-105191: Cleanup peg generator; keep only necessary files (#105197)
Lysandros Nikolaou [Thu, 1 Jun 2023 15:24:15 +0000 (17:24 +0200)] 
gh-105191: Cleanup peg generator; keep only necessary files (#105197)

2 years agogh-105145: Deprecate Py_GetPath() function (#105179)
Victor Stinner [Thu, 1 Jun 2023 12:06:32 +0000 (14:06 +0200)] 
gh-105145: Deprecate Py_GetPath() function (#105179)

Deprecate old Python initialization functions:

* PySys_ResetWarnOptions()
* Py_GetExecPrefix()
* Py_GetPath()
* Py_GetPrefix()
* Py_GetProgramFullPath()
* Py_GetProgramName()
* Py_GetPythonHome()

_tkinter.c uses sys.executable instead of Py_GetProgramName()
and uses sys.prefix instead of Py_GetPrefix().

2 years agogh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)
Victor Stinner [Thu, 1 Jun 2023 11:41:56 +0000 (13:41 +0200)] 
gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)

Remove functions in the C API:

* PyEval_AcquireLock()
* PyEval_ReleaseLock()
* PyEval_InitThreads()
* PyEval_ThreadsInitialized()

But keep these functions in the stable ABI.

Mention "make regen-limited-abi" in "make regen-all".

2 years agogh-89886: Rely on HAVE_SYS_TIME_H (#105058)
Erlend E. Aasland [Thu, 1 Jun 2023 11:37:40 +0000 (13:37 +0200)] 
gh-89886: Rely on HAVE_SYS_TIME_H (#105058)

Quoting autoconf (v2.71):

    All current systems provide time.h; it need not be checked for.
    Not all systems provide sys/time.h, but those that do, all allow
    you to include it and time.h simultaneously.

2 years agoremove unused #includes of pycore_pymem.h (#105166)
Irit Katriel [Thu, 1 Jun 2023 11:12:53 +0000 (12:12 +0100)] 
remove unused #includes of pycore_pymem.h (#105166)

2 years agogh-103224: Use the realpath of the Python executable in `test_venv` (GH-103243)
Artem Mukhin [Thu, 1 Jun 2023 09:39:59 +0000 (11:39 +0200)] 
gh-103224: Use the realpath of the Python executable in `test_venv` (GH-103243)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2 years agogh-105107: Remove PyCFunction_Call() function (#105181)
Victor Stinner [Thu, 1 Jun 2023 09:25:55 +0000 (11:25 +0200)] 
gh-105107: Remove PyCFunction_Call() function (#105181)

* Keep the function in the stable ABI.
* Add unit tests on PyCFunction_Call() since it remains supported in
  the stable ABI.

2 years agogh-105156: Update Lib/test/clinic.test manually (#105180)
Victor Stinner [Thu, 1 Jun 2023 08:46:17 +0000 (10:46 +0200)] 
gh-105156: Update Lib/test/clinic.test manually (#105180)

Update Lib/test/clinic.test manually for updated Py_UNICODE
converter: it now uses wchar_t type rather than Py_UNICODE.

2 years agoFix docstring of `warnings._deprecated` to show correct `remove` value (#105178)
Nikita Sobolev [Thu, 1 Jun 2023 08:07:52 +0000 (11:07 +0300)] 
Fix docstring of `warnings._deprecated` to show correct `remove` value (#105178)

2 years agogh-105156: Cleanup usage of old Py_UNICODE type (#105158)
Victor Stinner [Thu, 1 Jun 2023 07:18:09 +0000 (09:18 +0200)] 
gh-105156: Cleanup usage of old Py_UNICODE type (#105158)

* refcounts.dat:

  * Remove Py_UNICODE functions.
  * Replace Py_UNICODE argument type with wchar_t.

* _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(),
  _PyUnicode_ToTitlecase() are no longer deprecated in comments.
  It's no longer needed since they now use Py_UCS4 type, rather than
  the deprecated Py_UNICODE type.
* gdb: Remove unused char_width() method.

2 years agogh-105145: Remove old functions to config Python init (#105154)
Victor Stinner [Thu, 1 Jun 2023 07:14:02 +0000 (09:14 +0200)] 
gh-105145: Remove old functions to config Python init (#105154)

Remove the following old functions to configure the Python
initialization, deprecated in Python 3.11:

* PySys_AddWarnOptionUnicode()
* PySys_AddWarnOption()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* PySys_SetArgvEx()
* PySys_SetArgv()
* PySys_SetPath()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Most of these functions are kept in the stable ABI, except:

* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Update Doc/extending/embedding.rst and Doc/extending/extending.rst to
use the new PyConfig API.

_testembed.c:

* check_stdio_details() now sets stdio_encoding and stdio_errors
  of PyConfig.
* Add definitions of functions removed from the API but kept in the
  stable ABI.
* test_init_from_config() and test_init_read_set() now use
  PyConfig_SetString() instead of PyConfig_SetBytesString().

Remove _Py_ClearStandardStreamEncoding() internal function.

2 years agogh-105156: Deprecate the old Py_UNICODE type in C API (#105157)
Victor Stinner [Thu, 1 Jun 2023 06:56:35 +0000 (08:56 +0200)] 
gh-105156: Deprecate the old Py_UNICODE type in C API (#105157)

Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API:
use wchar_t instead.

Replace Py_UNICODE with wchar_t in multiple C files.

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2 years agogh-105172: Fixed functools.lru_cache typed argument docstring. (GH-105173)
Bar Harel [Wed, 31 May 2023 22:56:06 +0000 (23:56 +0100)] 
gh-105172: Fixed functools.lru_cache typed argument docstring. (GH-105173)

2 years agogh-102251: Explicitly free state for test modules with state in test_import (#105085)
sunmy2019 [Wed, 31 May 2023 21:12:10 +0000 (05:12 +0800)] 
gh-102251: Explicitly free state for test modules with state in test_import (#105085)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agoClarify that error messages are better with PEP 701 (#105150)
Pablo Galindo Salgado [Wed, 31 May 2023 21:01:29 +0000 (22:01 +0100)] 
Clarify that error messages are better with PEP 701 (#105150)

Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
2 years agogh-103464: Add checks for arguments of pdb commands (GH-103465)
Tian Gao [Wed, 31 May 2023 20:51:46 +0000 (04:51 +0800)] 
gh-103464: Add checks for arguments of pdb commands (GH-103465)

2 years agogh-105146: Update links at end of Windows installer (uninstall/repair) (GH-105147)
Steve Dower [Wed, 31 May 2023 20:42:54 +0000 (21:42 +0100)] 
gh-105146: Update links at end of Windows installer (uninstall/repair) (GH-105147)

2 years agogh-105148: make _PyASTOptimizeState internal to ast_opt.c (#105149)
Irit Katriel [Wed, 31 May 2023 19:21:46 +0000 (20:21 +0100)] 
gh-105148: make _PyASTOptimizeState internal to ast_opt.c (#105149)

2 years agogh-105156: Argument Clinic avoids Py_UNICODE type (#105161)
Victor Stinner [Wed, 31 May 2023 17:52:33 +0000 (19:52 +0200)] 
gh-105156: Argument Clinic avoids Py_UNICODE type (#105161)

Argument Clinic now uses "const wchar_t*" type instead of
"const Py_UNICODE*" type for the "Py_UNICODE" format.

2 years agogh-105144: Runtime-checkable protocols: move all 'sanity checks' to `_ProtocolMeta...
Alex Waygood [Wed, 31 May 2023 17:02:25 +0000 (18:02 +0100)] 
gh-105144: Runtime-checkable protocols: move all 'sanity checks' to `_ProtocolMeta.__subclasscheck__` (#105152)

2 years agogh-104909: Split BINARY_OP into micro-ops (#104910)
Guido van Rossum [Wed, 31 May 2023 15:09:23 +0000 (08:09 -0700)] 
gh-104909: Split BINARY_OP into micro-ops (#104910)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2 years agogh-105111: remove deprecated macros Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END...
Irit Katriel [Wed, 31 May 2023 14:44:11 +0000 (15:44 +0100)] 
gh-105111: remove deprecated macros Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END (#105112)

2 years agogh-104773: cgi: Fix typo in What's New in Python 3.13 (#105139)
Victor Stinner [Wed, 31 May 2023 12:54:07 +0000 (14:54 +0200)] 
gh-104773: cgi: Fix typo in What's New in Python 3.13 (#105139)

2 years agogh-105096: Deprecate wave getmarkers() method (#105098)
Victor Stinner [Wed, 31 May 2023 12:09:41 +0000 (14:09 +0200)] 
gh-105096: Deprecate wave getmarkers() method (#105098)

wave: Deprecate the getmark(), setmark() and getmarkers() methods of
the Wave_read and Wave_write classes. They will be removed in Python
3.15.

2 years agogh-62948: IOBase finalizer logs close() errors (#105104)
Victor Stinner [Wed, 31 May 2023 11:41:19 +0000 (13:41 +0200)] 
gh-62948: IOBase finalizer logs close() errors (#105104)

2 years agogh-105096: Reformat wave documentation (#105136)
Victor Stinner [Wed, 31 May 2023 11:29:10 +0000 (13:29 +0200)] 
gh-105096: Reformat wave documentation (#105136)

Add ".. class::" markups in the wave documentation.

* Reformat also wave.py (minor PEP 8 changes).
* Remove redundant "import struct": it's already imported at top
  level.
* Remove wave.rst from .nitignore