Commit graph

118681 commits

Author SHA1 Message Date
Miss Islington (bot)
15ea4a4292
[3.12] gh-111784: Fix two segfaults in the elementtree module (GH-113405) (GH-113446)
First fix resolve situation when pyexpat module (which contains expat_CAPI
capsule) deallocates before _elementtree, so we need to hold a strong
reference to pyexpat module to.

Second fix resolve situation when module state is deallocated before
deallocation of XMLParser instances, which uses module state to clear
some stuff.
(cherry picked from commit 894f0e573d)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-12-24 09:25:05 +00:00
Miss Islington (bot)
7f2ebc84e8
[3.12] gh-112559: Avoid unnecessary conversion attempts to enum_klass in signal.py (GH-113040) (#113443)
(cherry picked from commit 050783cb37)

Co-authored-by: Yilei Yang <yileiyang@google.com>
2023-12-23 18:09:59 -08:00
Miss Islington (bot)
8f526d3c9a
[3.12] gh-109989: Fix test_c_locale_coercion when PYTHONIOENCODING is set (GH-113378) (#113398)
gh-109989: Fix test_c_locale_coercion when PYTHONIOENCODING is set (GH-113378)

* gh-109989: Fix test_c_locale_coercion when PYTHONIOENCODING is set

This fixes the existing tests when PYTHONIOENCODING is
set by unsetting PYTHONIOENCODING.

Also add a test that explicitly checks what happens
when PYTHONIOENCODING is set.

(cherry picked from commit 5f665e99e0)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-12-23 21:57:54 +01:00
Irit Katriel
9d72a5cae7
[3.12] gh-113297: Fix segfault in compiler for with statement with 19 context managers (#113327) (#113404) 2023-12-23 13:29:11 +00:00
Miss Islington (bot)
4882d508be
[3.12] gh-74573: document that ndbm can silently corrupt databases on macOS (GH-113354) (#113431)
gh-74573: document that ndbm can silently corrupt databases on macOS (GH-113354)

* gh-74573: document that ndbm can silently corrupt databases on macOS

The system ndbm implementation on macOS has an undocumented limitation
on the size of values and can silently corrupt database files when those
are exceeded.

(cherry picked from commit 593b4d81d2)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-12-23 13:49:33 +01:00
Serhiy Storchaka
fc4d2c3dc6
[3.12] gh-81682: Fix test failures when CPython is built without docstrings (GH-113410) (GH-113429)
(cherry picked from commit 4e5b27e6a3)
2023-12-23 11:50:01 +00:00
Miss Islington (bot)
fee2bc15f9
[3.12] gh-112925: Fix error in example of datetime.time.fromisoformat and add doctest marker (GH-112931) (GH-113427)
(cherry picked from commit bdc8d667ab)

Co-authored-by: F-park <52167622+F-park@users.noreply.github.com>
2023-12-23 10:50:00 +00:00
Serhiy Storchaka
c7874bb56f
[3.12] gh-113188: Fix shutil.copymode() and shutil.copystat() on Windows (GH-113285)
Previously they worked differenly if dst is a symbolic link:
they modified the permission bits of dst itself rather than the file
it points to if follow_symlinks is true or src is not a symbolic link,
and did nothing if follow_symlinks is false and src is a symbolic link.
2023-12-23 10:31:52 +00:00
Miss Islington (bot)
4259acd394
[3.12] gh-113384: Skip test_freeze for framework builds on macOS (GH-113390) (#113395)
gh-113384: Skip test_freeze for framework builds on macOS (GH-113390)
(cherry picked from commit bee627c1e2)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-22 12:06:46 +01:00
Miss Islington (bot)
d8825c2e76
[3.12] gh-65701: document that freeze doesn't work with framework builds on macOS (GH-113352) (#113362)
gh-65701: document that freeze doesn't work with framework builds on macOS (GH-113352)

* gh-65701: document that freeze doesn't work with framework builds on macOS

The framework install is inherently incompatible with freeze. Document
that that freeze doesn't work with framework builds and bail out
early when trying to run freeze anyway.

(cherry picked from commit df1eec3dae)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-12-22 11:16:30 +01:00
Hugo van Kemenade
2ddee2e245
[3.12] gh-110383: Improve accuracy of str.split() and str.rsplit() docstrings (GH-113355) (#113379)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-12-22 00:43:28 -07:00
Miss Islington (bot)
08d3b5dd30
[3.12] gh-113313: Note that slice support is not required for all sequences. (gh-113377) (gh-113382) 2023-12-21 22:00:52 +00:00
Miss Islington (bot)
c38ebb40d1
[3.12] gh-113343: Fix error check on mmap(2) (GH-113342) (#113374)
gh-113343: Fix error check on mmap(2) (GH-113342)

Fix error check on mmap(2)

It should check MAP_FAILED instead of NULL for error.

On mmap(2) man page:

  RETURN VALUE
       On success, mmap() returns a pointer to the mapped area.
       On error, the value MAP_FAILED (that is, (void *) -1) is
       returned, and errno is set to indicate the error.
(cherry picked from commit 6b70c3dc5a)

Co-authored-by: Namhyung Kim <namhyung@gmail.com>
2023-12-21 19:44:15 +00:00
Miss Islington (bot)
8836c2d91a
[3.12] Docs: OpenSSL wording ambiguity (GH-113296) (#113348)
Co-authored-by: Jan Brasna <1784648+janbrasna@users.noreply.github.com>
2023-12-21 07:56:06 +00:00
Miss Islington (bot)
88e089cdbc
[3.12] gh-112305: Fix check-clean-src to detect frozen_modules .h files. (GH-113344) (#113346)
gh-112305: Fix check-clean-src to detect frozen_modules .h files. (GH-113344)

A typo left this check broken so many of us who do out-of-tree builds
were seeing strange failures due to bad `Python/frozen_modules/*.h`
files being picked up from the source tree and used at build time from
different Python versions leading to errors like:

`Fatal Python error: _PyImport_InitCore: failed to initialize importlib`

Or similar once our build got to an "invoke the interpreter"
bootstrapping step due to incorrect bytecode being embedded.
(cherry picked from commit 103c4ea274)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-12-21 07:47:57 +00:00
Miss Islington (bot)
192711856b
[3.12] GH-113214: Fix SSLProto exception handling in SSL-over-SSL scenarios (GH-113334) (#113339)
When wrapped, `_SSLProtocolTransport._force_close(exc)` is called just like in the unwrapped scenario `_SelectorTransport._force_close(exc)` or `_ProactorBasePipeTransport._force_close(exc)` would be called, except here the exception needs to be passed through the `SSLProtocol._abort()` method, which didn't accept an exception object.

This commit ensures that this path works, in the same way that the uvloop implementation of SSLProto passes on the exception (on which the current implementation of SSLProto is based).

(cherry picked from commit 1ff0238594)

Co-authored-by: Martijn Pieters <mj@zopatista.com>
2023-12-20 16:51:36 -08:00
Miss Islington (bot)
b01caf1d9d
[3.12] gh-113255: Clarify docs for typing.reveal_type (GH-113286) (#113323)
gh-113255: Clarify docs for `typing.reveal_type` (GH-113286)
(cherry picked from commit 11ee912327)

Co-authored-by: Kir <note351@hotmail.com>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-12-20 17:36:45 +00:00
Miss Islington (bot)
44101e9cd3
[3.12] Fix typo in datamodel docs (GH-113314) (#113316)
Fix typo in datamodel docs (GH-113314)
(cherry picked from commit 5a7cc667f8)

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-12-20 12:05:33 +00:00
Miss Islington (bot)
68743e4473
[3.12] Fix typo in collections.abc docs example (GH-113310) (#113311)
Fix typo in collections.abc docs example (GH-113310)

Calling the instance reference arg for the __next__ method, "next", seems misleading as it would normally just be "self"
(cherry picked from commit 22b8945d76)

Co-authored-by: David Greaves <david@dgreaves.com>
2023-12-20 09:57:48 +00:00
Miss Islington (bot)
376b46d92b
[3.12] gh-108269: Add CFBundleAllowMixedLocalizations to Info.plist on macOS (GH-113213) (#113294)
gh-108269: Add CFBundleAllowMixedLocalizations to Info.plist on macOS (GH-113213)

Adding this key with a value of true enables detecting the
users prefered language in libraries accessing system APIs
for this.
(cherry picked from commit 4cfce3a4da)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-19 22:08:59 +01:00
Miss Islington (bot)
ce49a9f60e
[3.12] gh-102362: Fix macOS version number in result of sysconfig.get_platform() (GH-112942) (#113264)
gh-102362: Fix macOS version number in result of sysconfig.get_platform() (GH-112942)

Change _osx_support.get_platform_osx() to make sure that the
version number in the result includes at least a major and
minor version (e.g. 14.2) even if MACOSX_DEPLOYMENT_TARGET is
set to just a major version (e.g. 14).

This matches the versions expected by pip when selecting
appropriate wheels for installation.
(cherry picked from commit 893c9ccf48)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-19 19:51:17 +01:00
Hugo van Kemenade
72bbd88876
[3.12] gh-101100: Fix Sphinx warnings in library/ast.rst (GH-113289) (#113290) 2023-12-19 18:12:30 +02:00
Miss Islington (bot)
077cb7cae6
[3.12] gh-113234: tomllib docs: reorder conversion table & add remaining types (GH-113236) (GH-113283)
gh-113234: tomllib docs: reorder conversion table & add remaining types (GH-113236)
(cherry picked from commit 76d757b38b)

Co-authored-by: ryan-duve <ryan-duve@users.noreply.github.com>
2023-12-19 10:35:40 +00:00
Miss Islington (bot)
ca5a5231d3
[3.12] gh-113208: Mention namespace packages don't require __init__.py (GH-113209) (#113276)
Co-authored-by: Unique-Usman <86585626+Unique-Usman@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-12-19 08:46:13 +00:00
Miss Islington (bot)
1c2fcd8b99
[3.12] gh-113269: IDLE - Fix test_editor hang (macOS) (GH-113271) (#113272)
gh-113269: IDLE - Fix test_editor hang (macOS) (GH-113271)

Hangs on installed 3.13.0a2 on macOS Catalina.
Behavior on installed 3.12.1 and 3.11.7 is unknown.
(cherry picked from commit fa9ba02353)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-19 05:42:03 +00:00
Miss Islington (bot)
816b635124
[3.12] gh-113199: Make read1() and readline() of HTTPResponse close IO after reading all data (GH-113200) (GH-113259)
(cherry picked from commit 41336a72b9)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2023-12-18 20:36:45 +00:00
Stéphane Bidoul
52bbaa95b3
[3.12] gh-113246: Updated bundled pip to 23.3.2 (gh-113249) (#113253)
* [3.12] gh-113246: Updated bundled pip to 23.3.2 (gh-113249)

Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9a13)

Co-authored-by: Stéphane Bidoul <stephane.bidoul@gmail.com>
2023-12-18 11:21:43 +00:00
Hugo van Kemenade
e23657f0f2
[3.12] gh-101100: Fix Sphinx warnings in library/tarfile.rst (GH-113237) (#113244) 2023-12-18 07:11:35 +00:00
Miss Islington (bot)
38a41820ee
[3.12] Docs: Add label to grammar spec for linking from PEPs (GH-113235) (#113239)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-17 19:30:10 +00:00
Miss Islington (bot)
48e1558c23
[3.12] gh-112890: unittest Test Discovery page updated "unittest dropped the namspace packages support" (GH-113195) (GH-113228)
(cherry picked from commit 21d52995ea)

Co-authored-by: Taylor Packard <3.t.packard@gmail.com>
2023-12-17 11:20:46 +00:00
Miss Islington (bot)
f7cacc43f5
[3.12] IDLE: Add util and stub example comments (GH-113222) (#113223)
(cherry picked from commit cde1335485)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-17 01:18:21 +00:00
Miss Islington (bot)
3bfe2b6c2a
[3.12] gh-105912: document gotcha with using os.fork on macOS (GH-112871) (#113133)
gh-105912: document gotcha with using os.fork on macOS (GH-112871)

* gh-105912: document gotcha with using os.fork on macOS

Using ``fork(2)`` on macOS when also using higher-level
system APIs in the parent proces can crash on macOS because
those system APIs are not written to handle this usage
pattern.

There's nothing we can do about this other than documenting
the problem.

(cherry picked from commit 22511f77c2)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-12-16 10:12:10 +01:00
Miss Islington (bot)
37712aced6
[3.12] gh-113046: Revise csv.reader doc (GH-113207) (#113210)
Clarify nature of csvfile.
(cherry picked from commit 84df3172ef)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-16 08:19:01 +00:00
Miss Islington (bot)
d77d62ab79
[3.12] Add reshape() recipe to demonstrate a use case for batched() and chained.from_iterable() (gh-113198) (gh-113201) 2023-12-16 00:09:49 +00:00
Miss Islington (bot)
b9c5ffe6e7
[3.12] Use match/case in grouper() recipe (gh-113059) (gh-113197) 2023-12-15 22:39:11 +00:00
Miss Islington (bot)
85ee49c434
[3.12] Minor stylistic edit to the grouper recipe (gh-112759) (gh-113196) 2023-12-15 16:32:32 -06:00
Miss Islington (bot)
9c32d0267f
[3.12] gh-110746: Improve markup in `tkinter.ttk.rst` (GH-111236) (#113193)
gh-110746: Improve markup in ``tkinter.ttk.rst`` (GH-111236)

* gh-110746: Improve markup in tkinter.ttk.rst

* gh-110746: Improve markup in tkinter.ttk.rst

* 📜🤖 Added by blurb_it.

---------

(cherry picked from commit 00d2b6d1fc)

Co-authored-by: Akshat Khandelwal <35228810+akshatgokul@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-12-15 22:03:51 +01:00
Miss Islington (bot)
00324a77da
[3.12] gh-101100: Fix various Sphinx warnings for dunder references in the library/ directory (GH-113163) (#113183)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-15 17:22:07 +00:00
Hugo van Kemenade
e3396b2995
[3.12] gh-101100: Fix Sphinx nitpicks in library/numbers.rst (GH-113162) (#113182)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-15 17:21:09 +00:00
Miss Islington (bot)
8c92d64ede
[3.12] gh-113009: Fix multiprocessing Process.terminate() on Windows (GH-113128) (#113177)
gh-113009: Fix multiprocessing Process.terminate() on Windows (GH-113128)

On Windows, Process.terminate() no longer sets the returncode
attribute to always call WaitForSingleObject() in Process.wait().
Previously, sometimes the process was still running after
TerminateProcess() even if GetExitCodeProcess() is not STILL_ACTIVE.
(cherry picked from commit 4026ad5b2c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-15 15:21:02 +00:00
Miss Islington (bot)
ded4307fc1
[3.12] gh-61648: Detect line numbers of properties in doctests (GH-113161) (GH-113164)
(cherry picked from commit 8f8f0f97e1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-15 13:44:45 +00:00
Miss Islington (bot)
6259dfa945
[3.12] gh-101100: Fix Sphinx nitpicks in library/rlcompleter.rst (GH-113125) (#113158)
gh-101100: Fix Sphinx nitpicks in `library/rlcompleter.rst` (GH-113125)
(cherry picked from commit 7bb00f053e)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-15 09:04:31 +00:00
Miss Islington (bot)
614691a7e7
[3.12] Optimize unique_justseen() recipe for a common case. (gh-113147) (gh-113150) 2023-12-14 23:34:00 +00:00
Hugo van Kemenade
eda168f99e
[3.12] gh-101100: Cleanup mailbox docs (GH-113124) (#113144)
(cherry picked from commit 25061f5c98)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-14 21:26:26 +00:00
Hugo van Kemenade
2b0853973f
[3.12] gh-101100: Fix Sphinx warnings in whatsnew/2.3.rst (GH-112373) (#113142)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-14 14:09:46 -07:00
Miss Islington (bot)
b4eeb97f1b
[3.12] Remove itertool recipe with low pedagogical value (gh-113138) (gh-113140) 2023-12-14 20:42:36 +00:00
Miss Islington (bot)
bc23ad4b99
[3.12] bpo-36796: Clean the error handling in _testcapimodule.c (GH-13085) (GH-113132)
(cherry picked from commit a723a13bf1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2023-12-14 19:39:57 +00:00
Miss Islington (bot)
15114517dd
[3.12] gh-101100: Fix Sphinx nitpicks in library/collections.abc.rst (GH-113116) (#113136)
gh-101100: Fix Sphinx nitpicks in `library/collections.abc.rst` (GH-113116)
(cherry picked from commit 006355b2a9)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-14 19:32:30 +00:00
Miss Islington (bot)
6b295722aa
[3.12] Add recipe for totient() to demonstrate unique_justseen() and factor(). (gh-113131) (gh-113134) 2023-12-14 19:24:15 +00:00
Miss Islington (bot)
a157881dbc
[3.12] gh-113113: doc: use less ambiguously named variable (gh-113114) (gh-113122) 2023-12-14 16:25:07 +00:00