]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (#103339)
Irit Katriel [Thu, 8 Jun 2023 20:19:05 +0000 (21:19 +0100)] 
gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (#103339)

2 years agogh-100227: Lock Around Modification of the Global Allocators State (gh-105516)
Eric Snow [Thu, 8 Jun 2023 20:06:54 +0000 (14:06 -0600)] 
gh-100227: Lock Around Modification of the Global Allocators State (gh-105516)

The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.

2 years agogh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348)
Nikita Sobolev [Thu, 8 Jun 2023 18:40:15 +0000 (21:40 +0300)] 
gh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348)

* revert enum pickling from by-name to by-value

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2 years agogh-100227: Lock Around Adding Global Audit Hooks (gh-105515)
Eric Snow [Thu, 8 Jun 2023 18:38:15 +0000 (12:38 -0600)] 
gh-100227: Lock Around Adding Global Audit Hooks (gh-105515)

The risk of a race with this state is relatively low, but we play it safe anyway.

2 years agogh-104310: Rename the New Function in importlib.util (gh-105255)
Eric Snow [Thu, 8 Jun 2023 18:19:58 +0000 (12:19 -0600)] 
gh-104310: Rename the New Function in importlib.util (gh-105255)

The original name wasn't as clear as it could have been. This change includes the following:

* rename the function
* change the default value for "disable_check" to False
* add clues to the docstring that folks should probably not use the function

---------

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2 years agogh-100227: Lock Around Use of the Global "atexit" State (gh-105514)
Eric Snow [Thu, 8 Jun 2023 18:08:28 +0000 (12:08 -0600)] 
gh-100227: Lock Around Use of the Global "atexit" State (gh-105514)

The risk of a race with this state is relatively low, but we play it safe anyway.

2 years agoRevert "Move observability-relevant structure fields to the top" (#105512)
Pablo Galindo Salgado [Thu, 8 Jun 2023 15:59:38 +0000 (16:59 +0100)] 
Revert "Move observability-relevant structure fields to the top" (#105512)

2 years agotest_types: Replace raw assert statements (#105500)
Jelle Zijlstra [Thu, 8 Jun 2023 14:46:33 +0000 (07:46 -0700)] 
test_types: Replace raw assert statements (#105500)

2 years agoFurther improve docs for `typing.Annotated` (#105498)
Alex Waygood [Thu, 8 Jun 2023 14:36:30 +0000 (15:36 +0100)] 
Further improve docs for `typing.Annotated` (#105498)

2 years agoGH-105229: Remove remaining two-codeunit superinstructions (GH-105326)
Mark Shannon [Thu, 8 Jun 2023 11:35:34 +0000 (12:35 +0100)] 
GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)

* Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.

2 years agoMove observability-relevant structure fields to the top (#105271)
Gabriele N. Tornetta [Thu, 8 Jun 2023 10:41:24 +0000 (11:41 +0100)] 
Move observability-relevant structure fields to the top (#105271)

2 years agogh-105431: Remove unused stuff from `test_typing.NewTypeTests` (#105432)
Nikita Sobolev [Thu, 8 Jun 2023 06:30:42 +0000 (09:30 +0300)] 
gh-105431: Remove unused stuff from `test_typing.NewTypeTests` (#105432)

2 years agogh-104635: Eliminate redundant STORE_FAST instructions in the compiler (gh-105320)
Dong-hee Na [Wed, 7 Jun 2023 23:39:56 +0000 (08:39 +0900)] 
gh-104635: Eliminate redundant STORE_FAST instructions in the compiler (gh-105320)

2 years agoGH-104996: Defer joining of `pathlib.PurePath()` arguments. (GH-104999)
Barney Gale [Wed, 7 Jun 2023 22:27:06 +0000 (23:27 +0100)] 
GH-104996: Defer joining of `pathlib.PurePath()` arguments. (GH-104999)

Joining of arguments is moved to `_load_parts`, which is called when a
normalized path is needed.

2 years agogh-103171: Forward-port new tests for runtime-checkable protocols dec orated with...
Alex Waygood [Wed, 7 Jun 2023 22:25:17 +0000 (23:25 +0100)] 
gh-103171: Forward-port new tests for runtime-checkable protocols dec orated with `@final` (#105473)

Forward-port of the tests that were added to the 3.11 branch in #105445

2 years agogh-105390: Add explicit type cast (#105466)
Kirill Podoprigora [Wed, 7 Jun 2023 20:20:43 +0000 (23:20 +0300)] 
gh-105390: Add explicit type cast (#105466)

2 years agogh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465)
neonene [Wed, 7 Jun 2023 19:46:00 +0000 (04:46 +0900)] 
gh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465)

Fixes a typo in d2e2e53.

2 years agogh-90015: Document that PEP-604 unions do not support forward references (#105366)
Alex Waygood [Wed, 7 Jun 2023 17:26:23 +0000 (18:26 +0100)] 
gh-90015: Document that PEP-604 unions do not support forward references (#105366)

2 years agogh-104610: Stop looking for PREDICT() in the cases generator (#105459)
Guido van Rossum [Wed, 7 Jun 2023 17:00:10 +0000 (10:00 -0700)] 
gh-104610: Stop looking for PREDICT() in the cases generator (#105459)

We no longer use `PREDICT()`, it doesn't have any benefits.

2 years agoFix grammar and improve clarity for an deprecation message. (GH-105457)
Raymond Hettinger [Wed, 7 Jun 2023 16:29:04 +0000 (11:29 -0500)] 
Fix grammar and improve clarity for an deprecation message. (GH-105457)

2 years agoGH-104610: Remove the use of `PREDICT` macros. (GH-104651)
Mark Shannon [Wed, 7 Jun 2023 16:04:53 +0000 (17:04 +0100)] 
GH-104610: Remove the use of `PREDICT` macros. (GH-104651)

2 years agotyping: Improve documentation of generic classes and aliases (#105369)
Alex Waygood [Wed, 7 Jun 2023 14:02:40 +0000 (15:02 +0100)] 
typing: Improve documentation of generic classes and aliases (#105369)

2 years agogh-105437: Improve tests of type params names for PEP 695 (#105438)
Nikita Sobolev [Wed, 7 Jun 2023 13:44:47 +0000 (16:44 +0300)] 
gh-105437: Improve tests of type params names for PEP 695 (#105438)

2 years agogh-105430: Remove `typing._Immutable` unused internal helper (#105434)
Nikita Sobolev [Wed, 7 Jun 2023 13:43:00 +0000 (16:43 +0300)] 
gh-105430: Remove `typing._Immutable` unused internal helper (#105434)

2 years agogh-97797: Improve documentation for typing.Annotated (#105365)
Alex Waygood [Wed, 7 Jun 2023 13:35:34 +0000 (14:35 +0100)] 
gh-97797: Improve documentation for typing.Annotated (#105365)

2 years agoImprove docs for `typing.TypeAlias` (#105372)
Alex Waygood [Wed, 7 Jun 2023 13:31:02 +0000 (14:31 +0100)] 
Improve docs for `typing.TypeAlias` (#105372)

2 years agogh-105435: Fix spurious NEWLINE token if file ends with comment without a newline...
Pablo Galindo Salgado [Wed, 7 Jun 2023 12:31:48 +0000 (13:31 +0100)] 
gh-105435: Fix spurious NEWLINE token if file ends with comment without a newline (#105442)

2 years agogh-105375: Improve error handling in sqlite3 collation callback (#105412)
Erlend E. Aasland [Wed, 7 Jun 2023 11:10:28 +0000 (13:10 +0200)] 
gh-105375: Improve error handling in sqlite3 collation callback (#105412)

Check for error after each call to PyUnicode_FromStringAndSize().

2 years agogh-105390: Correctly raise TokenError instead of SyntaxError for tokenize errors...
Pablo Galindo Salgado [Wed, 7 Jun 2023 11:04:40 +0000 (12:04 +0100)] 
gh-105390: Correctly raise TokenError instead of SyntaxError for tokenize errors (#105399)

2 years agogh-89886: Use Autoconf quadrigraphs where appropriate (#105226)
Erlend E. Aasland [Wed, 7 Jun 2023 07:11:44 +0000 (09:11 +0200)] 
gh-89886: Use Autoconf quadrigraphs where appropriate (#105226)

2 years agogh-104692: Include commoninstall as a prerequisite for bininstall (#104693)
Jeffery To [Wed, 7 Jun 2023 06:59:56 +0000 (14:59 +0800)] 
gh-104692: Include commoninstall as a prerequisite for bininstall (#104693)

This ensures that `commoninstall` is completed before `bininstall` is
started when parallel builds are used (`make -j install`), and so the
`python3` symlink is only installed after all standard library modules
are installed.

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2 years agoImprove code examples in `typing.rst` (#105346)
Alex Waygood [Wed, 7 Jun 2023 06:47:11 +0000 (07:47 +0100)] 
Improve code examples in `typing.rst` (#105346)

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.