Commit graph

119186 commits

Author SHA1 Message Date
Miss Islington (bot)
0586d54241
[3.12] gh-118418: Use a default value for type_params in typing._eval_type (GH-118431) (#118436)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-04-30 16:26:38 +00:00
Miss Islington (bot)
a030bae584
[3.12] gh-117860: Add tests for resolving names when import rebind names (GH-118176) (GH-118432)
Add tests for "import", pkgutil.resolve_name() and unittest.mock.path()
for cases when "import a.b as x" and "from a import b as x" give
different results.
(cherry picked from commit c0eaa232f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-30 14:52:44 +00:00
Miss Islington (bot)
1b12ad5970
[3.12] gh-118404: Fix inspect.signature() for non-comparable callables (GH-118405) (GH-118424)
(cherry picked from commit 11f8348d78)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-30 12:33:54 +00:00
Miss Islington (bot)
668163865c
[3.12] gh-85453: Consistent backquotes on None occurences across datetime.rst (GH-118282) (#118419)
(cherry picked from commit 0f797402bc)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-04-30 10:44:23 +02:00
Miss Islington (bot)
97c0194c9f
gh-118347: Fix Windows installer not updating launcher (GH-118386)
(cherry picked from commit 96d8ca7ad6)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-04-29 21:16:17 +00:00
Miss Islington (bot)
8e7486f41d
[3.12] gh-118359: Improve docs for Bdb.user_call (GH-118368) (#118410)
gh-118359: Improve docs for Bdb.user_call (GH-118368)

The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
(cherry picked from commit 8e4fb5d260)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-04-29 21:07:56 +00:00
Miss Islington (bot)
e99059445e
[3.12] gh-118401: Docs: Use Sphinx short options (GH-118403) (#118407)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-29 14:31:14 -06:00
Miss Islington (bot)
0a1bed102b
[3.12] Docs: Upgrade to Sphinx 7.3 (GH-118397) (#118400)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-29 17:58:06 +00:00
Miss Islington (bot)
3989894a39
[3.12] gh-117566: fix IPv6Address.is_loopback for IPv4-mapped loopbacks (GH-117567) (GH-118391)
gh-117566: fix IPv6Address.is_loopback for IPv4-mapped loopbacks (GH-117567)

While properties like IPv6Address.is_private account for IPv4-mapped
IPv6 addresses, such as for example:

    >>> ipaddress.ip_address("192.168.0.1").is_private
    True
    >>> ipaddress.ip_address("::ffff:192.168.0.1").is_private
    True
...the same doesn't currently apply to the is_loopback property:
    >>> ipaddress.ip_address("127.0.0.1").is_loopback
    True
    >>> ipaddress.ip_address("::ffff:127.0.0.1").is_loopback
    False

At minimum, this inconsistency between different properties is
counter-intuitive. Moreover, ::ffff:127.0.0.0/104 is for all intents and
purposes a loopback address, and should be treated as such.

(cherry picked from commit fb7f79b4da)

Co-authored-by: Faidon Liambotis <paravoid@debian.org>
2024-04-29 14:41:26 +00:00
Miss Islington (bot)
817190c303
[3.12] gh-101100: Fix Sphinx warnings in library/faulthandler.rst (GH-118353) (#118366)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-28 12:41:02 -06:00
Miss Islington (bot)
9a91c7051f
[3.12] gh-101100: Fix Sphinx warnings in whatsnew/3.10.rst (GH-118356) (#118367)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-28 12:40:46 -06:00
Hugo van Kemenade
666a360844
[3.12] gh-101100: Fix Sphinx warnings in whatsnew/3.9.rst (GH-118364) (#118365) 2024-04-28 11:52:58 -06:00
Jelle Zijlstra
186fbe82f7
[3.12] Fix note in Enum.__new__ docs (GH-118284) (#118325)
(cherry picked from commit 5a4d3df2fa)

Co-authored-by: Philipp A <flying-sheep@web.de>
2024-04-26 16:25:31 -07:00
Kirill Podoprigora
ef12d239fa
[3.12] gh-117928: Bump the minimum Sphinx version to 6.2.1 (GH-117853) (#118321)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-26 17:18:58 +03:00
Miss Islington (bot)
db474606f7
[3.12] gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237) (GH-118309)
gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237)
(cherry picked from commit ef940dec40)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-04-26 11:56:10 +02:00
Serhiy Storchaka
8e3bd342f3
[3.12] gh-118042: Fix error in Telnet.__del__ when __init__() was not called (GH-118274) 2024-04-26 08:53:54 +03:00
Miss Islington (bot)
82e26d6bd0
[3.12] gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208) (#118269)
gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208)
(cherry picked from commit 796b3fb280)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-04-25 22:29:45 -07:00
Erlend E. Aasland
7a843e8390
[3.12] gh-118221: Always use the default row factory in sqlite3.iterdump() (#118223) (#118270)
sqlite3.iterdump() depends on the row factory returning resulting rows
as tuples; it will fail with custom row factories like for example a
dict factory.

With this commit, we explicitly reset the row factory of the cursor used
by iterdump(), so we always get predictable results. This does not
affect the row factory of the parent connection.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-25 08:33:35 +00:00
Thomas Grainger
fc1732ce3f
[3.12] GH-117894: prevent aclose()/athrow() being re-used after StopIteration (GH-117851) (GH-118226)
(cherry picked from commit 7d369d471c)
2024-04-25 09:13:47 +02:00
Miss Islington (bot)
33d1cfffe1
[3.12] gh-117968: Make the test for closed file more safe in the C API tests (GH-118230) (GH-118266)
The behavior of fileno() after fclose() is undefined, but it is the only
practical way to check whether the file was closed.
Only test this on the known platforms (Linux, Windows, macOS), where we
already tested that it works.
(cherry picked from commit 546cbcfa0e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-25 05:16:43 +00:00
Miss Islington (bot)
c784b3e8fc
[3.12] gh-85453: Make numeric literals consistent across datetime.rst (GH-118245) (#118248)
Remove code formatting from remaining numeric literals.
(cherry picked from commit 59a4d52973)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-04-24 20:27:19 +00:00
Miss Islington (bot)
0049e2bd38
[3.12] gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and variables (GH-118068) (#118244)
Also remove formatting from numeric literals.

(cherry picked from commit 809aa9a682)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-24 20:02:53 +00:00
Miss Islington (bot)
0691bd860d
[3.12] gh-118013: Use weakrefs for the cache key in inspect._shadowed_dict (GH-118202) (#118232)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-24 15:27:08 +00:00
Petr Viktorin
f86b17ac51
[3.12] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) (GH-118177)
* GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)

The _private_networks variables, used by various is_private
implementations, were missing some ranges and at the same time had
overly strict ranges (where there are more specific ranges considered
globally reachable by the IANA registries).

This patch updates the ranges with what was missing or otherwise
incorrect.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

The _address_exclude_many() call returns 8 networks for IPv4, 121
networks for IPv6.

[1] https://github.com/python/cpython/issues/61602

* GH-65056: Improve the IP address' is_global/is_private documentation (GH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf17af)
(cherry picked from commit 40d75c2b7f)

---------

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2024-04-24 14:29:30 +02:00
Miss Islington (bot)
2eaf9ba9ce
[3.12] bpo-40944: Fix IndexError when parse emails with truncated Message-ID, address, routes, etc (GH-20790) (GH-117974)
(cherry picked from commit 1aa8bbe62f)

Co-authored-by: Ivan Savin <acccko@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-23 20:50:43 +03:00
Miss Islington (bot)
4d34b7f201
[3.12] Fix typo in py_compile.rst (GH-118102) (GH-118191)
(cherry picked from commit 0d221e9a19)

Co-authored-by: Animesh Kumar <animesh0721@gmail.com>
2024-04-23 17:22:19 +00:00
Miss Islington (bot)
30e25d4ff9
[3.12] gh-118168: Fix Unpack interaction with builtin aliases (GH-118169) (#118178)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-23 13:57:36 +00:00
Miss Islington (bot)
fbe29e639d
[3.12] gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242) (GH-117508)
* gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242)
(cherry picked from commit fc5f68e58e)


Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-04-23 12:41:32 +00:00
Miss Islington (bot)
30725f0ad2
[3.12] gh-116741: Upgrade libexpat to 2.6.2 (GH-117296) (GH-118166)
gh-116741: Upgrade libexpat to 2.6.2 (GH-117296)

Upgrade libexpat to 2.6.2
(cherry picked from commit c9829eec08)

Co-authored-by: Seth Michael Larson <seth@python.org>
2024-04-23 01:30:59 +00:00
Serhiy Storchaka
8ae70c8761
[3.12] gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982) (GH-118011)
(cherry picked from commit 6078f2033e)

Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-04-22 18:59:28 +00:00
Miss Islington (bot)
c869f4ed5c
[3.12] gh-118030: Group definitions for ParamSpecArgs and ParamSpecKwargs in typing.rst (GH-118154) (#118155)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-04-22 15:04:11 +00:00
Miss Islington (bot)
312d8192f3
[3.12] gh-118148: Improve tests for shutil.make_archive() (GH-118149) (GH-118151)
(cherry picked from commit 287d939ed4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-22 13:43:34 +00:00
Miss Islington (bot)
b1e5f2746d
[3.12] gh-115986 Improve pprint documentation accuracy (GH-117403) (#118146)
(cherry picked from commit ceb6038b05)

Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-22 10:34:48 +00:00
Miss Islington (bot)
9ddaf75a4c
[3.12] gh-117995: Don't raise DeprecationWarnings for indexed nameless params (GH-118001) (#118142)
Filter out '?NNN' placeholders when looking for named params.

(cherry picked from commit 550483b7e6)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-04-22 06:58:41 +00:00
Miss Islington (bot)
6d87cb494b
[3.12] Docs: replace Harry Potter reference with Monty Python (GH-118130) (#118135)
Docs: replace Harry Potter reference with Monty Python (GH-118130)
(cherry picked from commit 1446024124)

Co-authored-by: Clément Robert <cr52@protonmail.com>
2024-04-21 18:10:15 +00:00
Nikita Sobolev
e3671ead94
[3.12] gh-118121: Fix test_doctest.test_look_in_unwrapped (#118122) (#118129) 2024-04-21 07:41:54 +00:00
Miss Islington (bot)
4d85f0ae76
[3.12] Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global (GH-114009) (#118128)
Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global (GH-114009)
(cherry picked from commit 1558d99316)

Co-authored-by: Quazi Irfan <quazirfan@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-21 01:50:01 +00:00
Miss Islington (bot)
23192aba20
[3.12] GH-115874: Fix segfault in FutureIter_dealloc (GH-118114)
GH-115874: Fix segfault in FutureIter_dealloc (GH-117741)
(cherry picked from commit d8f350309d)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-04-19 22:53:18 +00:00
Miss Islington (bot)
ecb8e2bdac
[3.12] gh-118100: Improve links in ast.rst (GH-118101) (#118110)
gh-118100: Improve links in `ast.rst` (GH-118101)
(cherry picked from commit 2aa11cca11)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-19 18:34:55 +00:00
Alex Waygood
5430f61437
[3.12] gh-114053: Fix bad interaction of PEP-695, PEP-563 and `get_type_hints` (#118009) (#118104)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-19 13:41:28 +00:00
Miss Islington (bot)
6584ad9aa7
[3.12] gh-88035: update doc-string of epoch in timemodule.c (GH-118076) (GH-118097)
Follow GH-88035, update doc-string of epoch in timemodule.c

The epoch is `January 1st, 1970 on all platforms`, according to
current documentation.
(cherry picked from commit 7c6cc00211)

Co-authored-by: lit <litlighilit@foxmail.com>
2024-04-19 11:44:59 +00:00
Miss Islington (bot)
26c659ecbd
[3.12] gh-87969: Align docs and docstrings with implementation for ctypes' [w]string_at() (GH-25384) (GH-118046)
gh-87969: Align docs and docstrings with implementation for ctypes' [w]string_at() (GH-25384)

The implementation uses 'ptr' for the name of the first parameter of
ctypes.string_at() and ctypes.wstring_at(). Align docs and docstrings
with the naming used in the implementation.

(cherry picked from commit 81a926bd20)

Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-04-19 13:23:26 +02:00
Miss Islington (bot)
f278b8fefc
[3.12] gh-116935: Document that heap types need to support garbage collection (GH-118021) (GH-118092)
gh-116935: Document that heap types need to support garbage collection (GH-118021)
(cherry picked from commit 5d54436574)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-04-19 11:44:19 +02:00
Miss Islington (bot)
15be34ade8
[3.12] gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc (GH-117920) (#118087)
gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc (GH-117920)
(cherry picked from commit 4605a197bd)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-04-19 10:57:51 +02:00
Miss Islington (bot)
a0f82dd6cc
[3.12] gh-64588: Clarify the difference between mu and xbar in statistics docs (GH-117333) (#118080)
gh-64588: Clarify the difference between mu and xbar in statistics docs (GH-117333)

Thanks Davin Potts for the clarification idea.
(cherry picked from commit fefd5d9711)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-04-19 05:42:35 +00:00
Tian Gao
bbb1a8e768
[3.12] gh-117535: Ignore made up file name "sys" for warnings (#118014) 2024-04-19 04:07:05 +00:00
Miss Islington (bot)
632f353d9e
[3.12] Use "Contributed by" in a couple of occurrences of 3.12 whatsnew (GH-118070) (#118078)
Use "Contributed by" in a couple of occurrences of 3.12 whatsnew (GH-118070)
(cherry picked from commit 398abdd6fa)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-04-19 03:34:56 +00:00
Miss Islington (bot)
be1fe1149f
[3.12] gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056) (GH-118058)
(cherry picked from commit ccdcd1d95a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-04-18 17:17:05 +00:00
Miss Islington (bot)
dd8b4d4d37
[3.12] gh-116932: Remove redundant NEWS entry (GH-118040) (#118041)
Co-authored-by: lyc8503 <me@lyc8503.site>
2024-04-18 12:24:43 +00:00
Miss Islington (bot)
aa2fc81ea3
[3.12] Doc: Render version/language selector on Read the Docs (GH-116966) (#118038)
Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2024-04-18 11:40:05 +00:00