]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoGH-113568: Stop raising deprecation warnings from pathlib ABCs (#113757)
Barney Gale [Fri, 5 Jan 2024 22:56:04 +0000 (22:56 +0000)] 
GH-113568: Stop raising deprecation warnings from pathlib ABCs (#113757)

2 years agogh-113360: Fix the documentation of module's attribute __test__ (GH-113393)
Serhiy Storchaka [Fri, 5 Jan 2024 22:23:16 +0000 (00:23 +0200)] 
gh-113360: Fix the documentation of module's attribute __test__ (GH-113393)

It can only be a dict since Python 2.4.

2 years agogh-85567: Fix resouce warnings in pickle and pickletools CLIs (GH-113618)
Serhiy Storchaka [Fri, 5 Jan 2024 22:12:34 +0000 (00:12 +0200)] 
gh-85567: Fix resouce warnings in pickle and pickletools CLIs (GH-113618)

Explicitly open and close files instead of using FileType.

2 years agoGH-113568: Stop raising auditing events from pathlib ABCs (#113571)
Barney Gale [Fri, 5 Jan 2024 21:41:19 +0000 (21:41 +0000)] 
GH-113568: Stop raising auditing events from pathlib ABCs (#113571)

Raise auditing events in `pathlib.Path.glob()`, `rglob()` and `walk()`,
but not in `pathlib._abc.PathBase` methods. Also move generation of a
deprecation warning into `pathlib.Path` so it gets the right stack level.

2 years agogh-113688: Split up gcmodule.c (gh-113715)
Sam Gross [Fri, 5 Jan 2024 20:17:16 +0000 (15:17 -0500)] 
gh-113688: Split up gcmodule.c (gh-113715)

This splits part of Modules/gcmodule.c of into Python/gc.c, which
now contains the core garbage collection implementation. The Python
module remain in the Modules/gcmodule.c file.

2 years agogh-112532: Tag mimalloc heaps and pages (#113742)
Sam Gross [Fri, 5 Jan 2024 20:08:50 +0000 (15:08 -0500)] 
gh-112532: Tag mimalloc heaps and pages (#113742)

* gh-112532: Tag mimalloc heaps and pages

Mimalloc pages are data structures that contain contiguous allocations
of the same block size. Note that they are distinct from operating
system pages. Mimalloc pages are contained in segments.

When a thread exits, it abandons any segments and contained pages that
have live allocations. These segments and pages may be later reclaimed
by another thread. To support GC and certain thread-safety guarantees in
free-threaded builds, we want pages to only be reclaimed by the
corresponding heap in the claimant thread. For example, we want pages
containing GC objects to only be claimed by GC heaps.

This allows heaps and pages to be tagged with an integer tag that is
used to ensure that abandoned pages are only claimed by heaps with the
same tag. Heaps can be initialized with a tag (0-15); any page allocated
by that heap copies the corresponding tag.

* Fix conversion warning

2 years agogh-101100: Fix Sphinx warnings in `library/pyclbr.rst` (#113739)
Hugo van Kemenade [Fri, 5 Jan 2024 19:15:07 +0000 (21:15 +0200)] 
gh-101100: Fix Sphinx warnings in `library/pyclbr.rst` (#113739)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-80532: Do not set ipv6type when cross-compiling (#17956)
Zackery Spytz [Fri, 5 Jan 2024 15:34:25 +0000 (07:34 -0800)] 
gh-80532: Do not set ipv6type when cross-compiling (#17956)

Co-authored-by: Xavier de Gaye <xdegaye@gmail.com>
2 years agogh-101100: Fix Sphinx warnings for 2.6 deprecations and removals (#113725)
Hugo van Kemenade [Fri, 5 Jan 2024 13:31:28 +0000 (15:31 +0200)] 
gh-101100: Fix Sphinx warnings for 2.6 deprecations and removals (#113725)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-113703: Correctly identify incomplete f-strings in the codeop module (#113709)
Pablo Galindo Salgado [Fri, 5 Jan 2024 12:16:46 +0000 (12:16 +0000)] 
gh-113703: Correctly identify incomplete f-strings in the codeop module (#113709)

2 years agoGH-113486: Do not emit spurious PY_UNWIND events for optimized calls to classes....
Mark Shannon [Fri, 5 Jan 2024 09:45:22 +0000 (09:45 +0000)] 
GH-113486: Do not emit spurious PY_UNWIND events for optimized calls to classes. (GH-113680)

2 years agogh-113320: Reduce the number of dangerous `getattr()` calls when constructing protoco...
Alex Waygood [Fri, 5 Jan 2024 01:01:48 +0000 (01:01 +0000)] 
gh-113320: Reduce the number of dangerous `getattr()` calls when constructing protocol classes (#113401)

- Only attempt to figure out whether protocol members are "method members" or not if the class is marked as a runtime protocol. This information is irrelevant for non-runtime protocols; we can safely skip the risky introspection for them.
- Only do the risky getattr() calls in one place (the runtime_checkable class decorator), rather than in three places (_ProtocolMeta.__init__, _ProtocolMeta.__instancecheck__ and _ProtocolMeta.__subclasscheck__). This reduces the number of locations in typing.py where the risky introspection could go wrong.
- For runtime protocols, if determining whether a protocol member is callable or not fails, give a better error message. I think it's reasonable for us to reject runtime protocols that have members which raise strange exceptions when you try to access them. PEP-544 clearly states that all protocol member must be callable for issubclass() calls against the protocol to be valid -- and if a member raises when we try to access it, there's no way for us to figure out whether it's a callable member or not!

2 years agogh-112532: Isolate abandoned segments by interpreter (#113717)
Sam Gross [Thu, 4 Jan 2024 22:21:40 +0000 (17:21 -0500)] 
gh-112532: Isolate abandoned segments by interpreter (#113717)

* gh-112532: Isolate abandoned segments by interpreter

Mimalloc segments are data structures that contain memory allocations along
with metadata. Each segment is "owned" by a thread. When a thread exits,
it abandons its segments to a global pool to be later reclaimed by other
threads. This changes the pool to be per-interpreter instead of process-wide.

This will be important for when we use mimalloc to find GC objects in the
`--disable-gil` builds. We want heaps to only store Python objects from a
single interpreter. Absent this change, the abandoning and reclaiming process
could break this isolation.

* Add missing '&_mi_abandoned_default' to 'tld_empty'

2 years agoGH-113225: Speed up `pathlib.Path.glob()` (#113226)
Barney Gale [Thu, 4 Jan 2024 20:48:26 +0000 (20:48 +0000)] 
GH-113225: Speed up `pathlib.Path.glob()` (#113226)

Use `os.DirEntry.path` as the string representation of child paths, unless
the parent path is empty, in which case we use the entry `name`.

2 years agogh-113538: Don't error in stream reader protocol callback when task is cancelled...
Guido van Rossum [Thu, 4 Jan 2024 20:20:21 +0000 (12:20 -0800)] 
gh-113538: Don't error in stream reader protocol callback when task is cancelled (#113690)

2 years agogh-113569: Display calls in Mock.assert_has_calls failure when empty (GH-113573)
wookie184 [Thu, 4 Jan 2024 19:11:34 +0000 (19:11 +0000)] 
gh-113569: Display calls in Mock.assert_has_calls failure when empty (GH-113573)

2 years agogh-113696: Docs: Annotate PyObject_CallOneArg and PyObject_CallNoArgs as returning...
Jamie Phan [Thu, 4 Jan 2024 14:05:31 +0000 (01:05 +1100)] 
gh-113696: Docs: Annotate PyObject_CallOneArg and PyObject_CallNoArgs as returning a strong reference (#113697)

2 years agoGH-113689: Fix broken handling of invalid executors (GH-113694)
Brandt Bucher [Thu, 4 Jan 2024 11:14:15 +0000 (03:14 -0800)] 
GH-113689: Fix broken handling of invalid executors (GH-113694)

2 years agogh-52161: Enhance Cmd support for docstrings (#110987)
Filip Łapkiewicz [Wed, 3 Jan 2024 19:37:34 +0000 (20:37 +0100)] 
gh-52161: Enhance Cmd support for docstrings (#110987)

In `cmd.Cmd.do_help` call `inspect.cleandoc()`,
to clean indentation and remove leading/trailing empty
lines from a dosctring before printing.

2 years agoDocument the `co_lines` method on code objects (#113682)
Alex Waygood [Wed, 3 Jan 2024 19:29:24 +0000 (19:29 +0000)] 
Document the `co_lines` method on code objects (#113682)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-113258: Write frozen modules to the build tree on Windows (GH-113303)
Itamar Oren [Wed, 3 Jan 2024 17:30:20 +0000 (09:30 -0800)] 
gh-113258: Write frozen modules to the build tree on Windows (GH-113303)

This ensures the source directory is not modified at build time, and different builds (e.g. different versions or GIL vs no-GIL) do not have conflicts.

2 years agogh-113603: Compiler no longer tries to maintain the no-empty-block invariant (#113636)
Irit Katriel [Wed, 3 Jan 2024 16:57:48 +0000 (16:57 +0000)] 
gh-113603: Compiler no longer tries to maintain the no-empty-block invariant (#113636)

2 years agogh-111926: Set up basic sementics of weakref API for freethreading (gh-113621)
Donghee Na [Wed, 3 Jan 2024 13:25:27 +0000 (22:25 +0900)] 
gh-111926: Set up basic sementics of weakref API for freethreading (gh-113621)

---------

Co-authored-by: Sam Gross <colesbury@gmail.com>
2 years agogh-101100: Fix Sphinx warnings for removed dead batteries (#113669)
Hugo van Kemenade [Wed, 3 Jan 2024 13:04:26 +0000 (15:04 +0200)] 
gh-101100: Fix Sphinx warnings for removed dead batteries (#113669)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago`functools.partial` docs: Use the more common spelling for "referenceable" (#113675)
Rodrigo Girão Serrão [Wed, 3 Jan 2024 12:50:44 +0000 (12:50 +0000)] 
`functools.partial` docs: Use the more common spelling for "referenceable" (#113675)

2 years agogh-113637: Let c_annotations.py to handle the spacing of Limited/Unstable API & Stabl...
Ege Akman [Wed, 3 Jan 2024 11:22:38 +0000 (14:22 +0300)] 
gh-113637: Let c_annotations.py to handle the spacing of Limited/Unstable API & Stable ABI translation strings (#113638)

2 years agoGH-113595: Don't enter invalid executor (GH-113596)
Mark Shannon [Wed, 3 Jan 2024 11:01:13 +0000 (11:01 +0000)] 
GH-113595: Don't enter invalid executor (GH-113596)

2 years agogh-113628: Fix test_site test with long stdlib paths (#113640)
Itamar Oren [Wed, 3 Jan 2024 00:30:53 +0000 (16:30 -0800)] 
gh-113628: Fix test_site test with long stdlib paths (#113640)

2 years agoGH-113657: Add back missing _SET_IP uops in tier two (GH-113662)
Brandt Bucher [Tue, 2 Jan 2024 22:09:57 +0000 (14:09 -0800)] 
GH-113657: Add back missing _SET_IP uops in tier two (GH-113662)

2 years agogh-110824 Temporarily skip test_sysconfig.test_library on macOS framework builds...
Skip Montanaro [Tue, 2 Jan 2024 21:29:08 +0000 (15:29 -0600)] 
gh-110824 Temporarily skip test_sysconfig.test_library on macOS framework builds. (GH-113298)

Co-authored-by: Ned Deily <nad@python.org>
2 years agogh-53502: Fix plistlib.dump() for naive datetime with aware_datetime option (GH-113645)
Serhiy Storchaka [Tue, 2 Jan 2024 19:45:36 +0000 (21:45 +0200)] 
gh-53502: Fix plistlib.dump() for naive datetime with aware_datetime option (GH-113645)

2 years agobuild(deps): bump actions/upload-artifact from 3 to 4 (#113614)
dependabot[bot] [Tue, 2 Jan 2024 16:20:17 +0000 (18:20 +0200)] 
build(deps): bump actions/upload-artifact from 3 to 4 (#113614)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years agobuild(deps): bump actions/stale from 8 to 9 (#113611)
dependabot[bot] [Tue, 2 Jan 2024 16:19:01 +0000 (18:19 +0200)] 
build(deps): bump actions/stale from 8 to 9 (#113611)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years agogh-111178: Avoid calling functions from incompatible pointer types in _tkinter.c...
Christopher Chavez [Tue, 2 Jan 2024 14:51:32 +0000 (08:51 -0600)] 
gh-111178: Avoid calling functions from incompatible pointer types in _tkinter.c (GH-112893)

Fix undefined behavior warnings (UBSan  -fsanitize=function).

2 years agogh-111178: Avoid calling functions from incompatible pointer types in dictobject...
Christopher Chavez [Tue, 2 Jan 2024 14:32:37 +0000 (08:32 -0600)] 
gh-111178: Avoid calling functions from incompatible pointer types in dictobject.c (#112892)

Fix undefined behavior warnings (UBSan  -fsanitize=function).

2 years agogh-111178: Avoid calling functions from incompatible pointer types in descrobject...
Christopher Chavez [Tue, 2 Jan 2024 14:03:39 +0000 (08:03 -0600)] 
gh-111178: Avoid calling functions from incompatible pointer types in descrobject.c (GH-112861)

Fix undefined behavior warnings (UBSan  -fsanitize=function), for example:

Python/generated_cases.c.h:3315:13: runtime error: call to function mappingproxy_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
descrobject.c:1160: note: mappingproxy_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3315:13 in

2 years agogh-111178: Avoid calling functions from incompatible pointer types in listobject...
Christopher Chavez [Tue, 2 Jan 2024 13:41:32 +0000 (07:41 -0600)] 
gh-111178: Avoid calling functions from incompatible pointer types in listobject.c (GH-112820)

Fix undefined behavior warnings (UBSan  -fsanitize=function), for example:

Objects/object.c:674:11: runtime error: call to function list_repr through pointer to incorrect function type 'struct _object *(*)(struct _object *)'
listobject.c:382: note: list_repr defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:674:11 in

2 years agogh-113602: Bail out when the parser tries to override existing errors (#113607)
Pablo Galindo Salgado [Tue, 2 Jan 2024 13:00:52 +0000 (13:00 +0000)] 
gh-113602: Bail out when the parser tries to override existing errors (#113607)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2 years agogh-81094: Refer to PEP 318 in compound_statements.rst (#113588)
John D. McDonald [Tue, 2 Jan 2024 08:40:14 +0000 (02:40 -0600)] 
gh-81094: Refer to PEP 318 in compound_statements.rst (#113588)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-101100: Fix Sphinx warnings from removed `~!` references (#113629)
Hugo van Kemenade [Tue, 2 Jan 2024 07:37:37 +0000 (09:37 +0200)] 
gh-101100: Fix Sphinx warnings from removed `~!` references (#113629)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agono-issue: Use the official term "free-threading" for GitHub Action (gh-113622)
Donghee Na [Tue, 2 Jan 2024 00:16:53 +0000 (09:16 +0900)] 
no-issue: Use the official term "free-threading" for GitHub Action (gh-113622)

2 years agoGH-113633: Use module state structure for _testcapi. (GH-113634)
Neil Schemenauer [Mon, 1 Jan 2024 23:04:09 +0000 (15:04 -0800)] 
GH-113633: Use module state structure for _testcapi. (GH-113634)

Use module state structure for _testcapi.

2 years agogh-53502: Fixes for tests in gh-113363 (#113627)
Ronald Oussoren [Mon, 1 Jan 2024 20:31:43 +0000 (21:31 +0100)] 
gh-53502: Fixes for tests in gh-113363 (#113627)

* gh-53502: Fixes for tests in gh-113363

* Use 32-bit compatible date in test_dump_naive_datetime_with_aware_datetime_option

* Saving non-aware datetimes will use the old behaviour regardless of the aware_datimetime setting

2 years agogh-53502: add a new option aware_datetime in plistlib to loads or dumps aware datetim...
AN Long [Mon, 1 Jan 2024 18:51:24 +0000 (02:51 +0800)] 
gh-53502: add a new option aware_datetime in plistlib to loads or dumps aware datetime. (#113363)

* add options to loads and dumps aware datetime in plistlib

2 years agogh-113536: Expose `os.waitid` on macOS (#113542)
Ronald Oussoren [Mon, 1 Jan 2024 18:38:29 +0000 (19:38 +0100)] 
gh-113536: Expose `os.waitid` on macOS (#113542)

* gh-113536: Expose `os.waitid` on macOS

This API has been available on macOS for a long time, but was
explicitly excluded due to unspecified problems with the API
in ancient versions of macOS.

* Document that the API is available on macOS starting in Python 3.13

2 years agogh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374)
Jeffrey Kintscher [Mon, 1 Jan 2024 16:24:24 +0000 (08:24 -0800)] 
gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374)

The length field of StgDictObject for Structure class contains now
the total number of items in ffi_type_pointer.elements (excluding
the trailing null).

The old behavior of using the number of elements in the parent class can
cause the array to be truncated when it is copied, especially when there
are multiple layers of subclassing.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agobuild(deps): bump hypothesis from 6.91.0 to 6.92.2 in /Tools (#113615)
dependabot[bot] [Mon, 1 Jan 2024 09:42:44 +0000 (09:42 +0000)] 
build(deps): bump hypothesis from 6.91.0 to 6.92.2 in /Tools (#113615)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.91.0 to 6.92.2.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.91.0...hypothesis-python-6.92.2)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years agobuild(deps): bump github/codeql-action from 2 to 3 (#113613)
dependabot[bot] [Mon, 1 Jan 2024 09:30:30 +0000 (09:30 +0000)] 
build(deps): bump github/codeql-action from 2 to 3 (#113613)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years agobuild(deps): bump actions/setup-python from 4 to 5 (#113612)
dependabot[bot] [Mon, 1 Jan 2024 09:25:58 +0000 (09:25 +0000)] 
build(deps): bump actions/setup-python from 4 to 5 (#113612)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago# gh-111700: Fix syntax highlighting for C code in the "What's New In Python 3.12...
Parth Doshi [Mon, 1 Jan 2024 08:08:05 +0000 (00:08 -0800)] 
# gh-111700: Fix syntax highlighting for C code in the "What's New In Python 3.12" documentation (#113609)

Fix PEP 684 syntax highlighting in what's new Python 3.12

2 years agogh-101578: [doc] mention that PyErr_GetRaisedException returns NULL when the error...
Irit Katriel [Sun, 31 Dec 2023 23:16:33 +0000 (23:16 +0000)] 
gh-101578: [doc] mention that PyErr_GetRaisedException returns NULL when the error indicator is not set (#113369)

2 years agogh-101100: Fix Sphinx warnings in `library/configparser.rst` (#113598)
Hugo van Kemenade [Sun, 31 Dec 2023 17:57:33 +0000 (19:57 +0200)] 
gh-101100: Fix Sphinx warnings in `library/configparser.rst` (#113598)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoUpdate ConfigParser docs defining valid section name (#110506)
Delgan [Sat, 30 Dec 2023 23:18:06 +0000 (00:18 +0100)] 
Update ConfigParser docs defining valid section name (#110506)

2 years agogh-89414: Document that SIGCLD is not available on macOS (#113580)
Ronald Oussoren [Sat, 30 Dec 2023 15:19:47 +0000 (16:19 +0100)] 
gh-89414: Document that SIGCLD is not available on macOS (#113580)

Document that SIGCLD is not available on macOS

2 years agogh-112536: Add support for thread sanitizer (TSAN) (gh-112648)
Samet YASLAN [Sat, 30 Dec 2023 08:17:02 +0000 (09:17 +0100)] 
gh-112536: Add support for thread sanitizer (TSAN) (gh-112648)

2 years agogh-103708: Make directory layout in sysconfig implementation configurable (#103709)
Ankit Kumar Pandey [Fri, 29 Dec 2023 17:55:17 +0000 (23:25 +0530)] 
gh-103708: Make directory layout in sysconfig implementation configurable (#103709)

2 years agogh-103092: Make ``pyexpat`` module importable in sub-interpreters (#113555)
Kirill Podoprigora [Fri, 29 Dec 2023 13:13:46 +0000 (16:13 +0300)] 
gh-103092: Make ``pyexpat`` module importable in sub-interpreters (#113555)

2 years agoGH-113528: Remove a couple of expensive pathlib ABC tests (#113534)
Barney Gale [Thu, 28 Dec 2023 22:44:29 +0000 (22:44 +0000)] 
GH-113528: Remove a couple of expensive pathlib ABC tests (#113534)

Run expensive tests for walking and globbing from `test_pathlib` but not
`test_pathlib_abc`. The ABCs are not as tightly optimised as the classes
in top-level `pathlib`, and so these tests are taking rather a long time on
some buildbots. Coverage of the main `pathlib` classes should suffice.

2 years agoGH-113225: Speed up `pathlib._abc.PathBase.glob()` (#113556)
Barney Gale [Thu, 28 Dec 2023 22:23:01 +0000 (22:23 +0000)] 
GH-113225: Speed up `pathlib._abc.PathBase.glob()` (#113556)

`PathBase._scandir()` is implemented using `iterdir()`, so we can use its
results directly, rather than passing them through `_make_child_relpath()`.

2 years agoDoc/library/os.rst: `os.waitid` absent on MacOS (#104558)
John Hawkinson [Thu, 28 Dec 2023 19:36:20 +0000 (14:36 -0500)] 
Doc/library/os.rst: `os.waitid` absent on MacOS (#104558)

* Doc/library/os.rst: `os.waitid` absent on MacOS

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2 years agogh-101100: Fix Sphinx warnings in library/random.rst (#112981)
Hugo van Kemenade [Thu, 28 Dec 2023 19:29:12 +0000 (21:29 +0200)] 
gh-101100: Fix Sphinx warnings in library/random.rst (#112981)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event ...
Nikita Sobolev [Thu, 28 Dec 2023 18:58:06 +0000 (21:58 +0300)] 
gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (#113544)

2 years agobpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX (GH-19856)
Zackery Spytz [Thu, 28 Dec 2023 10:47:44 +0000 (02:47 -0800)] 
bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX (GH-19856)

Always include <sys/types.h> before <sys/sysmacros.h>.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-103092: Make `_elementtree` module importable in sub-interpreters (#113434)
Kirill Podoprigora [Thu, 28 Dec 2023 09:12:21 +0000 (12:12 +0300)] 
gh-103092: Make `_elementtree` module importable in sub-interpreters (#113434)

Enable imports of _elementtree module in sub-interpreters

2 years agogh-110459: Make sure --with-openssl-rpath works on macOS (#113441)
Ronald Oussoren [Thu, 28 Dec 2023 08:42:05 +0000 (09:42 +0100)] 
gh-110459: Make sure --with-openssl-rpath works on macOS (#113441)

* gh-110459: Make sure --with-openssl-rpath works on macOS

On macOS the `-rpath` linker flag is spelled differently
than on on platforms.

2 years agogh-73427: deprecate `_enablelegacywindowsfsencoding` (#107729)
Inada Naoki [Thu, 28 Dec 2023 08:31:19 +0000 (17:31 +0900)] 
gh-73427: deprecate  `_enablelegacywindowsfsencoding` (#107729)

2 years agogh-113299: Move cpp.py into libclinic (#113526)
Erlend E. Aasland [Wed, 27 Dec 2023 23:20:57 +0000 (00:20 +0100)] 
gh-113299: Move cpp.py into libclinic (#113526)

2 years agogh-113317: Rework Argument Clinic cpp.py error handling (#113525)
Erlend E. Aasland [Wed, 27 Dec 2023 21:43:19 +0000 (22:43 +0100)] 
gh-113317: Rework Argument Clinic cpp.py error handling (#113525)

Rework error handling in the C preprocessor helper. Instead of monkey-
patching the cpp.Monitor.fail() method from within clinic.py, rewrite
cpp.py to use a subclass of the ClinicError exception. As a side-effect,
ClinicError is moved into Tools/clinic/libclinic/errors.py.

Yak-shaving in preparation for putting cpp.py into libclinic.

2 years agogh-57795: Add news to idlelib/News3.txt (#113522)
Terry Jan Reedy [Wed, 27 Dec 2023 20:51:49 +0000 (15:51 -0500)] 
gh-57795: Add news to idlelib/News3.txt (#113522)

2 years agogh-67641: Clarify documentation on bytes vs text with non-seeking tarfile stream...
Stanley [Wed, 27 Dec 2023 17:16:36 +0000 (09:16 -0800)] 
gh-67641: Clarify documentation on bytes vs text with non-seeking tarfile stream (GH-31610)

2 years agobpo-26791: Update shutil.move() to provide the same symlink move behavior as the...
Jeffrey Kintscher [Wed, 27 Dec 2023 16:23:42 +0000 (08:23 -0800)] 
bpo-26791: Update shutil.move() to provide the same symlink move behavior as the mv shell when moving a symlink into a directory that is the target of the symlink (GH-21759)

2 years agoGH-110109: pathlib ABCs: drop use of `warnings._deprecated()` (#113419)
Barney Gale [Wed, 27 Dec 2023 15:40:03 +0000 (15:40 +0000)] 
GH-110109: pathlib ABCs: drop use of `warnings._deprecated()` (#113419)

The `pathlib._abc` module will be made available as a PyPI backport
supporting Python 3.8+. The `warnings._deprecated()` function was only
added last year, and it's private from an external package perspective, so
here we switch to `warnings.warn()` instead.

2 years agoGH-110109: pathlib ABCs: drop use of `io.text_encoding()` (#113417)
Barney Gale [Wed, 27 Dec 2023 15:32:35 +0000 (15:32 +0000)] 
GH-110109: pathlib ABCs: drop use of `io.text_encoding()` (#113417)

Do not use the locale-specific default encoding in `PathBase.read_text()`
and `write_text()`. Locale settings shouldn't influence the operation of
these base classes, which are intended mostly for implementing rich paths
on *nonlocal* filesystems.

2 years agogh-57795: IDLE: Enter the selected text when opening the "Replace" dialog (GH-17593)
Zackery Spytz [Wed, 27 Dec 2023 14:27:40 +0000 (06:27 -0800)] 
gh-57795: IDLE: Enter the selected text when opening the "Replace" dialog (GH-17593)

Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-64020: Deprecate pydoc.ispackage() (GH-20908)
Zackery Spytz [Wed, 27 Dec 2023 14:04:31 +0000 (06:04 -0800)] 
gh-64020: Deprecate pydoc.ispackage() (GH-20908)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-101100: Fix Sphinx warnings in `library/cmd.rst` (#113502)
Hugo van Kemenade [Wed, 27 Dec 2023 10:17:30 +0000 (12:17 +0200)] 
gh-101100: Fix Sphinx warnings in `library/cmd.rst` (#113502)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-101100: Fix Sphinx warnings in `library/calendar.rst` (#113500)
Hugo van Kemenade [Wed, 27 Dec 2023 09:36:17 +0000 (11:36 +0200)] 
gh-101100: Fix Sphinx warnings in `library/calendar.rst` (#113500)

2 years agogh-111615: Fix regression in QueueHandler configuration. (GH-111638)
Vinay Sajip [Wed, 27 Dec 2023 09:35:15 +0000 (09:35 +0000)] 
gh-111615: Fix regression in QueueHandler configuration. (GH-111638)

2 years agogh-113350: Improve the wording of python logging docs to remove an ambiguity around...
Vaishnavi Maheshwari [Wed, 27 Dec 2023 07:51:45 +0000 (13:21 +0530)] 
gh-113350: Improve the wording of python logging docs to remove an ambiguity around use of the word "higher". (GH-113491)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
2 years agogh-113332: Simplify calls to SSL_(CTX_)set_verify in _ssl.c (#113333)
David Benjamin [Tue, 26 Dec 2023 21:35:41 +0000 (16:35 -0500)] 
gh-113332: Simplify calls to SSL_(CTX_)set_verify in _ssl.c (#113333)

_ssl.c currently tries to preserve the verification callback, but at no
point does it ever set one. Just pass in NULL.

2 years agogh-101100: Fix Sphinx warnings in `library/bisect.rst` (#113496)
Hugo van Kemenade [Tue, 26 Dec 2023 21:12:15 +0000 (23:12 +0200)] 
gh-101100: Fix Sphinx warnings in `library/bisect.rst` (#113496)

2 years agogh-101100: Fix Sphinx warnings in `howto/isolating-extensions.rst` (#113493)
Hugo van Kemenade [Tue, 26 Dec 2023 19:40:48 +0000 (21:40 +0200)] 
gh-101100: Fix Sphinx warnings in `howto/isolating-extensions.rst` (#113493)

2 years agobpo-36959: Fix error messages for invalid ISO format string in _strptime() (GH-13408)
Gordon P. Hemsley [Tue, 26 Dec 2023 19:26:17 +0000 (14:26 -0500)] 
bpo-36959: Fix error messages for invalid ISO format string in _strptime() (GH-13408)

Previously some error messages complained about incompatible
combinations of directives that are not contained in the format string.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-112532: Fix peg generator build.py for mimalloc build (gh-113492)
Donghee Na [Tue, 26 Dec 2023 17:54:16 +0000 (17:54 +0000)] 
gh-112532: Fix peg generator build.py for mimalloc build (gh-113492)

gh-112532: Fix peg generator for mimalloc build

2 years agogh-112532: Use separate mimalloc heaps for GC objects (gh-113263)
Sam Gross [Tue, 26 Dec 2023 16:53:20 +0000 (11:53 -0500)] 
gh-112532: Use separate mimalloc heaps for GC objects (gh-113263)

* gh-112532: Use separate mimalloc heaps for GC objects

In `--disable-gil` builds, we now use four separate heaps in
anticipation of using mimalloc to find GC objects when the GIL is
disabled. To support this, we also make a few changes to mimalloc:

* `mi_heap_t` and `mi_tld_t` initialization is split from allocation.
  This allows us to have a `mi_tld_t` per-`PyThreadState`, which is
  important to keep interpreter isolation, since the same OS thread may
  run in multiple interpreters (using different PyThreadStates.)

* Heap abandoning (mi_heap_collect_ex) can now be called from a
  different thread than the one that created the heap. This is necessary
  because we may clear and delete the containing PyThreadStates from a
  different thread during finalization and after fork().

* Use enum instead of defines and guard mimalloc includes.

* The enum typedef will be convenient for future PRs that use the type.
* Guarding the mimalloc includes allows us to unconditionally include
  pycore_mimalloc.h from other header files that rely on things like
  `struct _mimalloc_thread_state`.

* Only define _mimalloc_thread_state in Py_GIL_DISABLED builds

2 years agogh-111971: Make _PyUnicode_FromId thread-safe in --disable-gil (gh-113489)
Donghee Na [Tue, 26 Dec 2023 16:48:33 +0000 (16:48 +0000)] 
gh-111971: Make _PyUnicode_FromId thread-safe in --disable-gil (gh-113489)

2 years agoDocs: make htmllive: open browser when ready (#113288)
Hugo van Kemenade [Tue, 26 Dec 2023 12:02:13 +0000 (14:02 +0200)] 
Docs: make htmllive: open browser when ready (#113288)

2 years agogh-113468: Remove the "_new_ suffix from class names in pydocfodder (GH-113469)
Serhiy Storchaka [Tue, 26 Dec 2023 10:54:05 +0000 (12:54 +0200)] 
gh-113468: Remove the "_new_ suffix from class names in pydocfodder (GH-113469)

2 years agogh-66515: mailbox.MH now supports folders withou the ".mh_sequences" file (GH-804)
Serhiy Storchaka [Tue, 26 Dec 2023 09:15:14 +0000 (11:15 +0200)] 
gh-66515: mailbox.MH now supports folders withou the ".mh_sequences" file (GH-804)

(for example Claws Mail IMAP-cache folders).

2 years agoMisc minor improvements to the itertools recipes (gh-113477)
Raymond Hettinger [Mon, 25 Dec 2023 22:26:04 +0000 (16:26 -0600)] 
Misc minor improvements to the itertools recipes (gh-113477)

2 years agogh-106905: Use separate structs to track recursion depth in each PyAST_mod2obj call...
Yilei Yang [Mon, 25 Dec 2023 17:36:59 +0000 (09:36 -0800)] 
gh-106905: Use separate structs to track recursion depth in each PyAST_mod2obj call. (GH-113035)

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2 years agobpo-21360: mailbox.Maildir now ignores files with a leading dot (GH-11833)
Zackery Spytz [Mon, 25 Dec 2023 15:07:51 +0000 (07:07 -0800)] 
bpo-21360: mailbox.Maildir now ignores files with a leading dot (GH-11833)

The maildir format specification states that files with a leading dot
should be ignored.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agofix bullet-list in `LOAD_SUPER_ATTR` documentation on `dis` page (#113461)
denballakh [Sun, 24 Dec 2023 20:28:39 +0000 (23:28 +0300)] 
fix bullet-list in `LOAD_SUPER_ATTR` documentation on `dis` page (#113461)

2 years agoGH-111485: Fix handling of FOR_ITER in Tier 2 (GH-113394)
Mark Shannon [Sun, 24 Dec 2023 18:07:34 +0000 (18:07 +0000)] 
GH-111485:  Fix handling of FOR_ITER in Tier 2 (GH-113394)

2 years agogh-113407: Fix import of unittest.mock when CPython is built without docstrings ...
Serhiy Storchaka [Sun, 24 Dec 2023 11:38:56 +0000 (13:38 +0200)] 
gh-113407: Fix import of unittest.mock when CPython is built without docstrings (GH-113408)

2 years agoAdd codeowners for `Lib/ensurepip/` (#112805)
Alex Waygood [Sun, 24 Dec 2023 11:09:50 +0000 (11:09 +0000)] 
Add codeowners for `Lib/ensurepip/` (#112805)

2 years agogh-113191: Add support of os.fchmod() on Windows (GH-113192)
Serhiy Storchaka [Sun, 24 Dec 2023 10:57:11 +0000 (12:57 +0200)] 
gh-113191: Add support of os.fchmod() on Windows (GH-113192)

Also support a file descriptor in os.chmod().

2 years agogh-113440: Ignore the "ver" command failure with exit code 0xc0000142 (GH-113435)
Serhiy Storchaka [Sun, 24 Dec 2023 10:31:23 +0000 (12:31 +0200)] 
gh-113440: Ignore the "ver" command failure with exit code 0xc0000142 (GH-113435)

2 years agogh-113421: Fix multiprocessing logger for "%(filename)s" (GH-113423)
Xu Song [Sun, 24 Dec 2023 10:04:12 +0000 (18:04 +0800)] 
gh-113421: Fix multiprocessing logger for "%(filename)s" (GH-113423)

2 years agogh-113028: Correctly memoize str in pickle when escapes added (GH-113436)
Jeff Allen [Sun, 24 Dec 2023 09:43:44 +0000 (09:43 +0000)] 
gh-113028: Correctly memoize str in pickle when escapes added (GH-113436)

This fixes a divergence between the Python and C implementations of pickle
for protocol 0, such that it pickle.py fails to re-use the first pickled
representation of strings involving characters that have to be escaped.