Commit graph

123216 commits

Author SHA1 Message Date
Miss Islington (bot)
2019362d95
[3.13] Doc: Upgrade Sphinx to 8.1 (GH-125276) (#125278)
Doc: Upgrade Sphinx to 8.1 (GH-125276)
(cherry picked from commit dd0ee201da)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-10 20:31:40 +00:00
Miss Islington (bot)
319305c0bf
[3.13] Note argparse exit code in documentation (GH-119568) (GH-125274)
(cherry picked from commit 3b87fb74c9)

Co-authored-by: Justin Kunimune <justinkunimune@gmail.com>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-10 21:18:17 +03:00
Miss Islington (bot)
2f87976926
[3.13] GH-122578: update to WASI SDK 24 (GH-122960) (GH-122961)
GH-122578: update to WASI SDK 24 (GH-122960)
(cherry picked from commit 0e207f3e7a)

Co-authored-by: Brett Cannon <brett@python.org>
2024-10-10 17:46:01 +00:00
Miss Islington (bot)
cc1892d3cf
[3.13] GH-121634: have wasi.py accept the host target triple as an argument (GH-123030) (GH-123042)
GH-121634: have `wasi.py` accept the host target triple as an argument (GH-123030)
(cherry picked from commit b15b81ed4f)

Co-authored-by: Brett Cannon <brett@python.org>
2024-10-10 17:44:31 +00:00
Miss Islington (bot)
9aa85f524f
[3.13] gh-122765: make prompt in activate.csh robust against unbalanced quotes and newlines (GH-123751) (GH-124185)
gh-122765: make prompt in activate.csh robust against unbalanced quotes and newlines (GH-123751)
(cherry picked from commit a15a584bf3)

Co-authored-by: Jacek <jacek.duszenko@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2024-10-10 17:39:39 +00:00
Sergey B Kirpichev
c2cb1a89b7
[3.13] gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169) (#125263)
memcopy'ing arbitrary values to _Bool variable triggers undefined
behaviour. Avoid this.
We assume that `false` is represented by all zero bytes.

Credits to Alex Gaynor.

(cherry picked from commit 87d7315ac5)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-10-10 14:58:57 +00:00
Miss Islington (bot)
0c43d60e7d
[3.13] gh-124471: Set name for unnamed reusable workflow (GH-124475) (gh-125256)
gh-124471: Set name for unnamed reusable workflow (GH-124475)
(cherry picked from commit e4cab488d4)

Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-10-10 13:03:45 +00:00
Miss Islington (bot)
47ad32d158
[3.13] gh-71784: [doc] add usage examples for traceback.TracebackException (GH-125189) (#125247)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-10 10:46:31 +00:00
Adam Turner
abb01fd938
[3.13] GH-121970: Extract `availability` into a new extension (GH-125082) (#125237)
(cherry picked from commit cbfd392479)
2024-10-10 10:43:43 +00:00
Miss Islington (bot)
288a0692ed
[3.13] Pin the doctest workflow to Ubuntu 22.04 (GH-125236) (#125240)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-10 10:27:48 +00:00
Miss Islington (bot)
85cf3a9dbe
[3.13] gh-125140: Remove the current directory from sys.path when using pyrepl (GH-125212) (#125224) 2024-10-10 10:35:47 +01:00
Alex Waygood
aa4da1e468
[3.13] gh-101100: Consolidate documentation on ModuleType attributes (#124709) (#125208)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-09 20:03:30 +01:00
Miss Islington (bot)
47fa3f44ef
[3.13] docs: in venv table use executable name (GH-124315) (GH-125172)
(cherry picked from commit 7f93dbf6fe)
2024-10-09 17:54:15 +01:00
Miss Islington (bot)
ab5f1790d0
[3.13] gh-101100: Fix Sphinx warnings in library/unittest.mock.rst (GH-124106) (#125190)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-10-09 14:13:23 +00:00
Miss Islington (bot)
b6c17eb76f
[3.13] Fix importlib.resources issue reference in 3.13 What's New (GH-125175) (#125184)
Previous link was to the PR that removed the
mentioned importlib.resources APIs, rather than
the issue that added back their improved forms.

(cherry picked from commit 7a303fc78a)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-10-09 22:45:03 +10:00
Miss Islington (bot)
dde8805d51
[3.13] gh-125150: Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues (GH-125151) (#125173)
gh-125150: Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues (GH-125151)

Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues
(cherry picked from commit 92760bd85b)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-10-09 09:05:57 +00:00
Savannah Ostrowski
5f2a5ac9dc
[3.13] GH-124478: Cleanup argparse documentation (GH-124877) (#125162)
(cherry picked from commit 37228bd16e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-10-08 16:20:01 -07:00
Miss Islington (bot)
21a99add45
[3.13] Misc improvements to the itertools docs (gh-125147) (gh-125149) 2024-10-08 14:37:13 -05:00
Raymond Hettinger
988cdccbe0
[3.13] Itertool docs: Minor clarifications, wording tweaks, spacing, and active voice. (gh-124690) (gh-125148)
Minor clarifications, wording tweaks, spacing, and active voice.
2024-10-08 14:29:15 -05:00
Raymond Hettinger
7bc99dd49e
[3.13] Tee of tee was not producing n independent iterators (gh-123884) (gh-125081) 2024-10-08 14:11:43 -05:00
Miss Islington (bot)
f5fea4dec6
[3.13] gh-124832: Add a note to indicate that datetime.now may return the same instant (GH-124834) (#125145)
gh-124832: Add a note to indicate that `datetime.now` may return the same instant (GH-124834)

* Update datetime.rst

* Update datetime.rst

replace warning with note

* Update Doc/library/datetime.rst



* Update Doc/library/datetime.rst



---------

(cherry picked from commit 760b1e103a)

Co-authored-by: spacemanspiff2007 <10754716+spacemanspiff2007@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-08 18:26:07 +00:00
Kumar Aditya
20242a437c
[3.13] gh-117721: use PyMutex in _thread.lock (#125110) (#125116)
* gh-117721: use PyMutex in `_thread.lock` (#125110)

(cherry picked from commit fca552993d)
2024-10-08 21:16:48 +05:30
Jelle Zijlstra
089c6d2961
[3.13] gh-112433 add versionadded for ctypes.Structure._align_ (GH-125087) (#125113)
(cherry picked from commit 5967dd8a4d)

Co-authored-by: monkeyman192 <monkey_man_192@yahoo.com.au>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-10-08 14:24:27 +00:00
Victor Stinner
5df6a756a5
[3.13] gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097) (#125111)
gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097)

If the PYTHON_BASIC_REPL environment variable is set, the site module
no longer imports the _pyrepl module.

Moreover, the site module now respects -E and -I command line
options: ignore PYTHON_BASIC_REPL in this case.

(cherry picked from commit 65ce228d63)
2024-10-08 14:20:05 +00:00
Miss Islington (bot)
0a63c66035
[3.13] Doc: Improve description of `GET_LEN` opcode (GH-114583) (#125102)
Doc: Improve description of ``GET_LEN`` opcode (GH-114583)
(cherry picked from commit e8773e59a8)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-10-08 12:30:52 +00:00
Miss Islington (bot)
84991153da
[3.13] gh-123378: fix a crash in UnicodeError.__str__ (GH-124935) (#125099)
gh-123378: fix a crash in `UnicodeError.__str__` (GH-124935)
(cherry picked from commit ba14dfafd9)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-08 12:06:57 +00:00
Felix Fontein
4eab6e8d29
[3.13] gh-118658: Modify cert generation script to extract cert3.pem (GH-124598) (GH-124972)
(cherry picked from commit 480354dc23)
2024-10-08 13:37:30 +02:00
Alyssa Coghlan
64391363ed
[3.13] bpo-34206: Improve docs and test coverage for pre-init functions (GH-8023) (#125092)
- move the Py_Main documentation from the very high level API section
  to the initialization and finalization section
- make it clear that it encapsulates a full Py_Initialize/Finalize
  cycle of its own
- point out that exactly which settings will be read and applied
  correctly when Py_Main is called after a separate runtime
  initialization call is version dependent
- be explicit that Py_IsInitialized can be called prior to
  initialization
- actually test that Py_IsInitialized can be called prior to
  initialization
- flush stdout in the embedding tests that run code so it appears
  in the expected order when running with "-vv"
- make "-vv" on the subinterpreter embedding tests less spammy

---------

(cherry picked from commit 7c4b6a68f2)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-08 09:30:06 +00:00
Miss Islington (bot)
9e61aa9b38
[3.13] gh-53203: Improve tests for strptime() (GH-125090) (GH-125091)
Run them with different locales and different date and time.

Add the @run_with_locales() decorator to run the test with multiple
locales.

Improve the run_with_locale() context manager/decorator -- it now
catches only expected exceptions and reports the test as skipped if no
appropriate locale is available.
(cherry picked from commit 19984fe024)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-08 12:12:15 +03:00
Serhiy Storchaka
ea2ccb3d43
[3.13] gh-85935: Improve tests for invalid arguments in test_argparse (GH-124891) (GH-124901)
Check also specific error messages.
(cherry picked from commit 2c050d4bc2)
2024-10-08 11:19:30 +03:00
Miss Islington (bot)
0e0a2dadec
[3.13] gh-70870: Clarify dual usage of 'free variable' (GH-122545) (#125088)
The term "free variable" has unfortunately become genuinely
ambiguous over the years (presumably due to the names of
some relevant code object instance attributes).

While we can't eliminate that ambiguity at this late date, we can
at least alert people to the potential ambiguity by describing
both the formal meaning of the term and the common
alternative use as a direct synonym for "closure variable".

---------

(cherry picked from commit 27390990fa)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-08 17:58:47 +10:00
Serhiy Storchaka
e28f2c6705
[3.13] gh-58282: Fix support of tuple metavar for positional arguments in argparse (GH-124782) (GH-124882)
Previously, formatting help output or error message for positional argument
with a tuple metavar raised exception.

(cherry picked from commit 9b31a2d83f)

Co-authored-by: Cyker Way <cykerway@gmail.com>
2024-10-08 06:36:38 +00:00
Miss Islington (bot)
1e820e63e7
[3.13] gh-124653: Relax (again) detection of queue API for logging handlers (GH-124897) (GH-125059)
(cherry picked from commit 7ffe94fb24)
2024-10-08 07:23:40 +01:00
Jelle Zijlstra
761c3b280b
[3.13] gh-102511: Change the os.path.splitroot param name from path back to p (GH-124097) (#124919)
(cherry picked from commit 3b6bfa77aa)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-10-07 18:42:49 -07:00
Miss Islington (bot)
d869d54962
[3.13] gh-125018: Fix role syntax (GH-125050) (#125080)
gh-125018: Fix role syntax (GH-125050)
(cherry picked from commit 10094a533a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-08 01:23:19 +00:00
Alyssa Coghlan
b0d01a1513
[3.13] gh-125018: Add importlib.metadata semantic link targets (GH-125027) (#125047)
gh-125018: Add importlib.metadata semantic link targets (#125027)

This allows direct intersphinx references to APIs via references
like `` :func:`importlib.metadata.version` ``.

(cherry picked from commit cda3b5a576)

---------

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-08 02:16:10 +01:00
Miss Islington (bot)
12bb9ed279
[3.13] Docs: make a tutorial example more precise (GH-125066) (#125078)
(cherry picked from commit 6e3c70c61b)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-10-08 02:15:42 +01:00
Emily Morehouse
9a1b9d5254
[3.13] gh-125072: Add label for assignment expressions; update tracked section for assignment expression topic (GH-125074) (#125077)
(cherry picked from commit 447a15190d)
2024-10-08 02:14:34 +01:00
Raymond Hettinger
84efcecf03
[3.13] Small improvements to the itertools docs (GH-123885) (#125075) 2024-10-07 23:08:09 +00:00
Serhiy Storchaka
6925e5b5c7
[3.13] gh-58573: Fix conflicts between abbreviated long options in the parent parser and subparsers in argparse (GH-124631) (GH-124760)
Check for ambiguous options if the option is consumed, not when it is
parsed.
(cherry picked from commit 3f27153e07)
2024-10-07 22:55:27 +00:00
Miss Islington (bot)
0a046771c0
[3.13] gh-72795: Make positional arguments with nargs='*' or REMAINDER non-required (GH-124306) (#124421)
This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.
(cherry picked from commit 3c83f9958c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-07 22:51:35 +00:00
Miss Islington (bot)
db3ccd8b62
[3.13] gh-53780: Ignore the first "--" (double dash) between an option and command in argparse (GH-124275) (GH-125073)
(cherry picked from commit c578271366)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-07 22:51:07 +00:00
Miss Islington (bot)
a380dc6836
[3.13] gh-124130: Increase test coverage for \b and \B in regular expressions (GH-124330) (GH-124413)
(cherry picked from commit b82f07653e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-07 21:58:17 +00:00
Miss Islington (bot)
566983dd12
[3.13] gh-124182: Explain naming rules for struct sequence types (GH-124335) (#125057)
gh-124182: Explain naming rules for struct sequence types (GH-124335)
(cherry picked from commit 3287c834e5)

Co-authored-by: ffelixg <142172984+ffelixg@users.noreply.github.com>
2024-10-07 23:47:30 +02:00
Miss Islington (bot)
2d3087b3cf
[3.13] gh-120378: Fix crash caused by integer overflow in curses (GH-124555) (#124905)
gh-120378: Fix crash caused by integer overflow in `curses` (GH-124555)

This is actually an upstream problem in curses, and has been reported
to them already:
https://lists.gnu.org/archive/html/bug-ncurses/2024-09/msg00101.html

This is a nice workaround in the meantime to prevent the segfault.

(cherry picked from commit c2ba931318)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-07 23:46:57 +02:00
Miss Islington (bot)
f5f1d45f17
[3.13] gh-116810: fix memory leak in ssl module (GH-123249) (#124800)
gh-116810: fix memory leak in ssl module (GH-123249)

Resolve a memory leak introduced in CPython 3.10's :mod:`ssl` when the :attr:`ssl.SSLSocket.session` property was accessed. Speeds up read and write access to said property by no longer unnecessarily cloning session objects via serialization.

(cherry picked from commit 7e7223e18f)

Co-authored-by: Jeffrey R. Van Voorst <jeff.vanvoorst@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Antoine Pitrou <antoine@python.org>
2024-10-07 23:46:29 +02:00
Miss Islington (bot)
a93716f695
[3.13] gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block 3fff::/20 (GH-124240) (#124282)
gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::/20` (GH-124240)
(cherry picked from commit db6eb3640a)

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
2024-10-07 23:45:59 +02:00
Miss Islington (bot)
9e218afc85
[3.13] Support the "pager" binary in _pyrepl (GH-122878) (#124242)
Support the "pager" binary in _pyrepl (GH-122878)

Debian (and derivatives) provide a /usr/bin/pager binary, managed by the
alternatives system, that always points to an available pager utility.
Allow _pyrepl to use it, to follow system policy.

This is a very trivial change, from a patch that Debian has been
carrying since 2.7 era. Seems appropriate to upstream.
https://bugs.debian.org/799555
(cherry picked from commit 426569eb8c)

Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
Co-authored-by: T. Wouters <thomas@python.org>
2024-10-07 23:45:43 +02:00
Victor Stinner
d432fa43b9
[3.13] Fix typos (#123775) (#123866)
Fix typos (#123775)

(cherry picked from commit 9017b95ff2)

Co-authored-by: algonell <algonell@gmail.com>
2024-10-07 23:44:31 +02:00
Miss Islington (bot)
2a40dda89d
[3.13] gh-95468: Add more tests for "--" (double dash) in test_argparse (GH-124274) (GH-125068)
(cherry picked from commit baa3550bc3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-07 21:40:47 +00:00