Commit Graph

116520 Commits

Author SHA1 Message Date
Miss Islington (bot) a27c540d20
[3.11] gh-96310: Fix a traceback in argparse when all options in a mutually exclusive group are suppressed (GH-96311) (GH-115768)
Reproducer depends on terminal size - the traceback occurs when there's
an option long enough so the usage line doesn't fit the terminal width.
Option order is also important for reproducibility.

Excluding empty groups (with all options suppressed) from inserts
fixes the problem.
(cherry picked from commit 5f7df88821)

Co-authored-by: Daniel Mach <daniel.mach@suse.com>
2024-02-21 18:20:08 +02:00
Miss Islington (bot) 35e5bbc845
[3.11] gh-114785: Remove content from `Porting from Python2` how-to (GH-114805) (GH-115328)
Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

(cherry picked from commit 705c76d4a2)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-21 13:50:07 +01:00
Miss Islington (bot) 6928d5e1f7
[3.11] gh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400) (GH-115761)
Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"
(cherry picked from commit fbd40ce46e)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2024-02-21 12:43:16 +01:00
Serhiy Storchaka 9068c8c614
[3.11] gh-115712: Support CSV dialects with delimiter=' ' and skipinitialspace=True (GH-115721) (GH-115729) (GH-115738)
(cherry picked from commit 5ea86f496a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
csv.writer() now quotes empty fields if delimiter is a space and
skipinitialspace is true and raises exception if quoting is not possible.
(cherry picked from commit 937d282150)
2024-02-20 19:09:10 +00:00
Miss Islington (bot) 142711a31d
[3.11] gh-86291: linecache: get module name from __spec__ if available (GH-22908) (GH-115732)
This allows getting source code for the __main__ module when a custom
loader is used.
(cherry picked from commit e976baba99)

Co-authored-by: Eugene Toder <eltoder@users.noreply.github.com>
2024-02-20 18:18:16 +00:00
Miss Islington (bot) aff083e8ee
[3.11] Add missed `stream` argument (GH-111775) (#115717)
Add missed `stream` argument (GH-111775)

* Add missed `stream` argument

* Add news
(cherry picked from commit 1ff6c1416b)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
2024-02-20 11:36:59 -05:00
Miss Islington (bot) 01c37f1d07
[3.11] gh-114572: Fix locking in cert_store_stats and get_ca_certs (GH-114573) (#115549)
gh-114572: Fix locking in cert_store_stats and get_ca_certs (GH-114573)

* gh-114572: Fix locking in cert_store_stats and get_ca_certs

cert_store_stats and get_ca_certs query the SSLContext's X509_STORE with
X509_STORE_get0_objects, but reading the result requires a lock. See
https://github.com/openssl/openssl/pull/23224 for details.

Instead, use X509_STORE_get1_objects, newly added in that PR.
X509_STORE_get1_objects does not exist in current OpenSSLs, but we can
polyfill it with X509_STORE_lock and X509_STORE_unlock.

* Work around const-correctness problem

* Add missing X509_STORE_get1_objects failure check

* Add blurb
(cherry picked from commit bce693111b)

Co-authored-by: David Benjamin <davidben@google.com>
2024-02-20 16:34:44 +00:00
Miss Islington (bot) 5a0d51b629
[3.11] gh-112020: Document the meaning of empty bytes returned by socket.recv() (GH-112055) (GH-115723)
(cherry picked from commit e71468ba4f)

Co-authored-by: talcs <talh8787@gmail.com>
2024-02-20 15:00:30 +00:00
Miss Islington (bot) b3384af464
[3.11] gh-115539: Allow enum.Flag to have None members (GH-115636) (GH-115695)
gh-115539: Allow enum.Flag to have None members (GH-115636)
(cherry picked from commit c2cb31bbe1)

Co-authored-by: Jason Zhang <yurenzhang2017@gmail.com>
2024-02-19 16:18:30 -08:00
Miss Islington (bot) f0104d2a2d
gh-115543: Update py.exe to know about Python 3.13 and to install 3.12 by default (GH-115544)
(cherry picked from commit 6cd18c75a4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-02-19 21:05:04 +00:00
Serhiy Storchaka c39baf15c5
[3.11] gh-115664: Fix versionadded and versionchanged directives in multiprocessing.rst (GH-115665) (GH-115682)
(cherry picked from commit 8f602981ba)
2024-02-19 20:52:17 +02:00
Brian Schubert 61f2085687
[3.11] gh-115664: Fix chronological ordering of versionadded and versionchanged directives (GH-115676) (#115681)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-02-19 18:42:19 +00:00
Miss Islington (bot) f10ce9fede
[3.11] Fix typo in multiprocessing docs (GH-115650) (#115680)
(cherry picked from commit 57d31ec359)

Co-authored-by: Naglis Jonaitis <827324+naglis@users.noreply.github.com>
2024-02-19 18:25:59 +00:00
Miss Islington (bot) c02b7ae4dd
[3.11] gh-60346: Improve handling single-dash options in ArgumentParser.parse_known_args() (GH-114180) (GH-115674)
(cherry picked from commit e47ecbd042)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-19 18:20:51 +00:00
Serhiy Storchaka e1994c43c0
[3.11] Fix test_compile with -O mode (GH-115346) (GH-115673)
(cherry picked from commit 7b25a82e83)
2024-02-19 18:06:13 +00:00
Miss Islington (bot) 0bb94f49e3
[3.11] gh-115341: Fix loading unit tests with doctests in -OO mode (GH-115342) (GH-115672)
(cherry picked from commit 872cc9957a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-19 17:54:59 +00:00
Miss Islington (bot) 55b9633316
[3.11] Fix test_py_compile with -O mode (GH-115345) (GH-115670)
(cherry picked from commit 07ef9d86a5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-19 17:45:56 +00:00
Miss Islington (bot) d4915220e7
[3.11] gh-115652: Fix indentation in the documentation of multiprocessing.get_start_method (GH-115658) (GH-115660)
(cherry picked from commit d504968983)

Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
2024-02-19 17:09:07 +02:00
Miss Islington (bot) eb759952ee
[3.11] Docs: Add explanation about little/big endian (GH-109841) (#115647)
Docs: Add explanation about little/big endian (GH-109841)
(cherry picked from commit 177b9cb52e)

Co-authored-by: Simon A. Eugster <simon.eu@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-02-19 07:57:00 +00:00
Kirill Podoprigora c69da47ac9
[3.11] gh-115572: Move `codeobject.replace()` docs to the data model … (#115632)
* [3.11] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631)
(cherry picked from commit 0c80da4c14)

Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>

* Remove note about copy.replace

---------

Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>
2024-02-18 14:37:27 +00:00
Miss Islington (bot) 91262320da
[3.11] gh-108303: Move `Lib/test/sortperf.py` to `Tools/scripts` (GH-114687) (#115626)
gh-108303: Move `Lib/test/sortperf.py` to `Tools/scripts` (GH-114687)
(cherry picked from commit f9154f8f23)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-02-18 07:43:36 +00:00
Miss Islington (bot) b87a443146
[3.11] gh-101100: Fix Sphinx warnings in `whatsnew/3.2.rst` (GH-115580) (#115590)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-17 14:51:28 -07:00
Serhiy Storchaka 5dac9c53cd
[3.11] gh-115618: Remove improper Py_XDECREFs in property methods (GH-115619) (GH-115621)
(cherry picked from commit 090dd21ab9)
2024-02-17 21:47:32 +00:00
Miss Islington (bot) cd0a071fdd
[3.11] gh-115596: Fix ProgramPriorityTests in test_os permanently changing the process priority (GH-115610) (GH-115617)
(cherry picked from commit 90dd653a61)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-02-17 19:14:41 +02:00
Kirill Podoprigora ee3d8dcb00
[3.11] gh-107155: Fix help() for lambda function with return annotation (GH-115613)
(cherry picked from commit b9a9e3dd62)
2024-02-17 17:39:48 +02:00
Miss Islington (bot) a23aecc737
[3.11] Fix ProgramPriorityTests on FreeBSD with high nice value (GH-100145) (GH-115615)
It expects priority to be capped with 19, which is the cap for Linux,
but for FreeBSD the cap is 20 and the test fails under the similar
conditions. Tweak the condition to cover FreeBSD as well.
(cherry picked from commit 437924465d)

Co-authored-by: Dmitry Marakasov <amdmi3@amdmi3.ru>
2024-02-17 15:38:38 +00:00
Serhiy Storchaka 6fbc61070f
[3.11] gh-100985: Consistently wrap IPv6 IP address during CONNECT (GH-100986) (GH-115606)
Update _get_hostport to always remove square brackets
from IPv6 addresses. Then add them if needed
in "CONNECT .." and "Host: ".
(cherry picked from commit 465db27cb9)

Co-authored-by: Derek Higgins <derekh@redhat.com>
2024-02-17 14:15:21 +00:00
Miss Islington (bot) a6776cdc53
[3.11] Document use of ANY in test assertions (GH-94060) (GH-115608)
(cherry picked from commit 04005f5021)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2024-02-17 13:24:40 +00:00
Serhiy Storchaka 51b974b0ab
[3.11] gh-96497: Mangle name before symtable lookup in 'symtable_extend_namedexpr_scope' (GH-96561) (GH-115604)
(cherry picked from commit 664965a1c1)

Co-authored-by: wookie184 <wookie1840@gmail.com>
2024-02-17 13:13:26 +00:00
Miss Islington (bot) 5b6e358913
[3.11] gh-101699: Explain using Match.expand with \g<0> (GH-101701) (GH-115584)
Update documentation for re library to explain that a backreference `\g<0>` is
expanded to the entire string when using Match.expand().
Note that numeric backreferences to group 0 (`\0`) are not supported.

(cherry picked from commit d2d7808853)

Co-authored-by: Stevoisiak <S.Vascellaro@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-02-17 15:03:43 +02:00
Miss Islington (bot) 4077f1445c
[3.11] gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419) (GH-115586)
(cherry picked from commit 9fd420f53d)

Co-authored-by: Peter Jiping Xie <peter.jp.xie@gmail.com>
2024-02-17 15:02:47 +02:00
Miss Islington (bot) 70754d21c2
[3.11] gh-100884: email/_header_value_parser: don't encode list separators (GH-100885) (GH-115593)
ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93c3d)

Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-02-17 15:01:02 +02:00
Miss Islington (bot) bc11905d48
[3.11] gh-87688: Amend SSLContext.hostname_checks_common_name docs (GH-100517) (GH-115595)
(cherry picked from commit debb1386be)

Co-authored-by: Rami <72725910+ramikg@users.noreply.github.com>
2024-02-17 14:59:31 +02:00
Miss Islington (bot) 8fccca2f50
[3.11] gh-56499: Update the pickle library's note section for the __setstate__ function (GH-101062) (GH-115598)
(cherry picked from commit d5a30a1777)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-02-17 14:56:54 +02:00
Miss Islington (bot) a5eaa14584
[3.11] gh-95782: Fix io.BufferedReader.tell() etc. being able to return offsets < 0 (GH-99709) (GH-115600)
lseek() always returns 0 for character pseudo-devices like
`/dev/urandom` (for other non-regular files, e.g. `/dev/stdin`, it
always returns -1, to which CPython reacts by raising appropriate
exceptions). They are thus technically seekable despite not having seek
semantics.

When calling read() on e.g. an instance of `io.BufferedReader` that
wraps such a file, `BufferedReader` reads ahead, filling its buffer,
creating a discrepancy between the number of bytes read and the internal
`tell()` always returning 0, which previously resulted in e.g.
`BufferedReader.tell()` or `BufferedReader.seek()` being able to return
positions < 0 even though these are supposed to be always >= 0.

Invariably keep the return value non-negative by returning
max(former_return_value, 0) instead, and add some corresponding tests.
(cherry picked from commit 26800cf25a)

Co-authored-by: 6t8k <58048945+6t8k@users.noreply.github.com>
2024-02-17 14:55:43 +02:00
Miss Islington (bot) 2c39d00a56
[3.11] gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825) (GH-115602)
Since 2f3941d743 this function returns the
response string, rather than nothing.
(cherry picked from commit e88ebc1c40)

Co-authored-by: Matthew Hughes <34972397+matthewhughes934@users.noreply.github.com>
2024-02-17 14:54:31 +02:00
Miss Islington (bot) ba2f2ca632
[3.11] gh-101100: Fix Sphinx warnings in `whatsnew/3.1.rst` (GH-115575) (#115588)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-17 02:47:54 -07:00
Miss Islington (bot) 7de9caec0d
[3.11] docs: Add glossary term references to shutil docs (GH-115559) (#115579)
docs: Add glossary term references to shutil docs (GH-115559)

Add glossary term references to shutil docs
(cherry picked from commit 318f2190bc)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-02-16 22:12:45 +00:00
Jelle Zijlstra c01a4808d3
[3.11] gh-115570: Fix DeprecationWarnings in test_typing (#115571)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-16 19:37:42 +00:00
Hugo van Kemenade 963315cbd9
[3.11] gh-100734: What's New in 3.x: Add missing detail from 3.x branch (GH-114689) (#115527) 2024-02-15 17:44:50 +02:00
Nikita Sobolev c3a274b0fe
[3.11] gh-108303: Move all `pydoc` related files to `test_pydoc` (GH-114506) (#115501)
(cherry picked from commit ccc76c3e88)
2024-02-15 16:36:10 +03:00
Miss Islington (bot) 9bb3f56592
[3.11] [3.12] GH-113516: don't set `LDSHARED` when building for WASI (GH-115495) (GH-115496) (GH-115497)
[3.12] GH-113516: don't set `LDSHARED` when building for WASI (GH-115495) (GH-115496)
(cherry picked from commit 0e4f73b8e4)

Co-authored-by: Brett Cannon <brett@python.org>
2024-02-14 17:34:45 -08:00
Donghee Na 1739efc57d
[3.11] gh-112087: Fix reduce logic for the empty reverse iterator for list (gh-115472) 2024-02-14 18:43:39 +00:00
Miss Islington (bot) c12b0a25e8
[3.11] Docs: spell out sentence about ndbm/gdbm file formats (GH-115470) (#115477)
(cherry picked from commit 49e8fdc1df)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-02-14 18:10:06 +00:00
Seth Michael Larson e071b0d558
[3.11] Upgrade bundled libexpat to 2.6.0 (GH-115399) (GH-115468)
Manual backport due to code differences.
2024-02-14 18:29:27 +01:00
Miss Islington (bot) 0e07ebdba4
[3.11] gh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH-115247) (GH-115466)
(cherry picked from commit 671360161f)

Co-authored-by: kcatss <kcats9731@gmail.com>
2024-02-14 17:21:12 +00:00
Miss Islington (bot) 7b94f47e68
[3.11] Docs: reword sentences about dbm submodule traits (GH-114609) (#115463)
Don't repeatedly say that keys and values are coerced into bytes.
(cherry picked from commit 81e140d10b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-02-14 15:56:04 +00:00
Miss Islington (bot) c4e8ffb9a1
[3.11] gh-115392: Fix doctest reporting incorrect line numbers for decorated functions (GH-115440) (#115458)
gh-115392: Fix doctest reporting incorrect line numbers for decorated functions (GH-115440)
(cherry picked from commit bb791c7728)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-02-14 15:55:48 +00:00
Hugo van Kemenade cb941e1264
[3.11] gh-101100: Fix sphinx warnings in `c-api/gcsupport.rst` (GH-114786) (#115430)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-02-14 16:32:58 +02:00
Miss Islington (bot) 8dae36d1fb
[3.11] gh-115403: Remove extra colon after "Examples" in datetime documentation (GH-115452) (#115456)
gh-115403: Remove extra colon after "Examples" in datetime documentation (GH-115452)
(cherry picked from commit 6755c4e0c8)

Co-authored-by: Stanislav Lyu <wallseat@gmail.com>
2024-02-14 17:07:21 +03:00