Commit graph

120204 commits

Author SHA1 Message Date
Peter Bierma
4219cda83d
[3.12] Pre-commit: Drop specific language version and bump hooks (GH-128801) (#128997) 2025-01-18 22:52:24 +02:00
Miss Islington (bot)
104d37ad99
[3.12] gh-121542: Document trailing newline behavior in set_content() (GH-121543) (#128996)
gh-121542: Document trailing newline behavior in `set_content()` (GH-121543)
(cherry picked from commit fba475ae6f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Yizheng Meng <dev@rapidcow.org>
2025-01-18 18:41:59 +00:00
Ed Nutting
bca489076f
[3.12] gh-127599: Fix _Py_RefcntAdd missing calls to _Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (GH-127717) (#128712)
Previously, `_Py_RefcntAdd` hasn't called
`_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect.

Now it has been fixed.
(cherry picked from commit ab05beb8ce)
2025-01-18 19:00:18 +02:00
Bénédikt Tran
3d9b14c19b
[3.12] gh-125997: suggest efficient alternatives for time.sleep(0) (GH-128752) (#128985) 2025-01-18 11:13:03 +00:00
Bénédikt Tran
fbbef609d1
[3.12] gh-127637: add tests for dis command-line interface (#127759) (#127780) 2025-01-18 12:01:56 +01:00
Miss Islington (bot)
405f6d72bb
[3.12] gh-128961: Fix exhausted array iterator crash in __setstate__() (GH-128962) (#128977)
(cherry picked from commit 4dade055f4)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
2025-01-18 10:14:07 +00:00
Miss Islington (bot)
8a8f5d636d
[3.12] gh-128916: Do not set SO_REUSEPORT on non-AF_INET* sockets (GH-128933) (#128970)
gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets (GH-128933)

* gh-128916: Do not set `SO_REUSEPORT` on non-`AF_INET*` sockets

Do not attempt to set ``SO_REUSEPORT`` on sockets of address familifies other
than ``AF_INET`` and ``AF_INET6``, as it is meaningless with these address
families, and the call with fail with Linux kernel 6.12.9 and newer.

* Apply suggestions from code review



---------
(cherry picked from commit 3829104ab4)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2025-01-18 01:06:45 +00:00
Miss Islington (bot)
8ee250bdd9
[3.12] Fix definition of a generator iterator in glossary.rst (GH-128952) (#128968)
Fix definition of a `generator iterator` in `glossary.rst` (GH-128952)

Fix possible typo/grammar in glossary.rst

As discussed in https://discuss.python.org/t/typo-in-glossary-entry-for-generator-iterator/77163
(cherry picked from commit 8174770d31)

Co-authored-by: Daniel F Moisset <dfmoisset@gmail.com>
2025-01-18 00:53:29 +00:00
Tian Gao
f45da82c11
[3.12] gh-58956: Fix a frame refleak in bdb (GH-128190) (#128953)
* [3.12] gh-58956: Fix a frame refleak in bdb (GH-128190)
(cherry picked from commit 767c89ba7c)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-01-17 14:19:37 -05:00
Miss Islington (bot)
dfd75dfeed
[3.12] gh-58689: Fix os.kill() error handling on Windows (GH-128932) (#128938)
gh-58689: Fix os.kill() error handling on Windows (GH-128932)
(cherry picked from commit 939df0f9f6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-17 12:48:24 +00:00
Miss Islington (bot)
1c85f1bc44
[3.12] gh-128017: Make a note that sys variables are read-only (GH-128887) (#128909)
gh-128017: Make a note that sys variables are read-only (GH-128887)
(cherry picked from commit 313b96eb8b)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-01-16 10:23:48 +00:00
Miss Islington (bot)
45b89bf0da
[3.12] gh-128816: Fix warnings in test_doctest (GH-128817) (GH-128871)
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader.
* Fix an import warning when importing readline (if it has not yet been imported).
(cherry picked from commit 599be687ec)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-01-16 09:09:13 +00:00
Miss Islington (bot)
0308bcfa04
[3.12] gh-97850: Suggest TraversableResources as the alternative for ResourceLoader (GH-128601) (GH-128896)
gh-97850: Suggest `TraversableResources` as the alternative for `ResourceLoader` (GH-128601)

Suggest TraversableResources as the alternative for ResourceLoader.

Previously, ResourceReader was the suggested alternative, but it
is itself deprecated in favour of TraversableResources.
(cherry picked from commit 256d6d2131)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-15 20:55:06 +00:00
Miss Islington (bot)
85255c4df2
[3.12] gh-67206: Document that string.printable is not printable in the POSIX sense (GH-128820) (#128867)
gh-67206: Document that `string.printable` is not printable in the POSIX sense (GH-128820)
(cherry picked from commit d906bde250)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-15 14:28:21 +00:00
Miss Islington (bot)
5675e06eca
[3.12] gh-128874: Fix the documentation for blurb 2.0 (GH-128875) (#128878)
gh-128874: Fix the documentation for blurb 2.0 (GH-128875)
(cherry picked from commit 40a4d88a14)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-15 14:20:08 +00:00
Bénédikt Tran
6c9b7e591b
[3.12] gh-128833: Patch test_embed.test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE on Windows (#128860)
Hotfix for `test_embed`
2025-01-15 14:22:45 +01:00
Miss Islington (bot)
febe67b993
[3.12] gh-109959: Skip test_glob.test_selflink() flaky test (GH-128812) (#128834)
gh-109959: Skip test_glob.test_selflink() flaky test (GH-128812)
(cherry picked from commit 1153e66e20)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-14 15:32:11 +00:00
Miss Islington (bot)
54c9597a50
[3.12] Fix a "doctest" block in Doc/library/turtle.rst (GH-128831) (#128836)
Fix a "doctest" block in `Doc/library/turtle.rst` (GH-128831)
(cherry picked from commit 1598e18a65)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-01-14 15:26:46 +00:00
Miss Islington (bot)
e7400d7877
[3.12] gh-125997: Increase test coverage for time.sleep() (GH-128751) (#128795)
gh-125997: Increase test coverage for `time.sleep()` (GH-128751)

- Add tests for durations of invalid types.
- Add tests for `int` and `float` durations, including signed zeroes durations.
- Add tests for nonzero very small durations and durations close to the clock resolution.

---------
(cherry picked from commit b70a567575)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-13 17:16:25 +00:00
Miss Islington (bot)
552b2a0f6e
[3.12] Explicitly import urllib.error in urllib.robotparser (GH-128737) (#128794)
Explicitly import `urllib.error` in `urllib.robotparser` (GH-128737)
(cherry picked from commit 53e8942e69)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-13 16:32:38 +00:00
Miss Islington (bot)
ca5ff6b40c
[3.12] gh-128562: Fix generation of the tkinter widget names (GH-128604) (GH-128792)
There were possible conflicts if the widget class name ends with a digit.
(cherry picked from commit da8825ea95)

Co-authored-by: Zhikang Yan <2951256653@qq.com>
2025-01-13 18:23:53 +02:00
Miss Islington (bot)
4facd7d119
[3.12] gh-128078: Clear exception in anext before calling _PyGen_SetStopIterationValue (GH-128780) (#128784)
gh-128078: Clear exception in `anext` before calling `_PyGen_SetStopIterationValue` (GH-128780)
(cherry picked from commit 76ffaef729)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-13 18:45:20 +05:30
Miss Islington (bot)
8448552579
[3.12] gh-123345: improve fnmatch docs (GH-123346) (#128775)
gh-123345: improve `fnmatch` docs (GH-123346)
(cherry picked from commit 29fe8072cf)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-13 10:40:22 +00:00
Miss Islington (bot)
b773f591a8
[3.12] gh-128731: Explicitly close socket on error in robotparser.RobotFileParser.read() (GH-128733) (GH-128756)
(cherry picked from commit 5e65a1acc0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-01-12 13:34:24 +00:00
Serhiy Storchaka
c20c551ce3
[3.12] gh-128734: Explicitly close sockets in urllib tests (GH-128735) (GH-128750)
(cherry picked from commit 5ace71713b)
2025-01-12 11:30:07 +00:00
Damien
a600439e42
[3.12] gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566) (#126621)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-01-12 00:23:53 +02:00
Miss Islington (bot)
07a65cdcc5
[3.12] gh-128302: Fix bugs in xml.dom.xmlbuilder (GH-128284) (#128583)
gh-128302: Fix bugs in xml.dom.xmlbuilder (GH-128284)

* Allow DOMParser.parse() to correctly handle DOMInputSource instances
  that only have a systemId attribute set.
* Fix DOMEntityResolver.resolveEntity(), which was broken by the
  Python 3.0 transition.
* Add Lib/test/test_xml_dom_xmlbuilder.py with few tests.
(cherry picked from commit 6ea04da270)

Co-authored-by: Stephen Morton <git@tungol.org>
2025-01-11 13:30:29 +02:00
Miss Islington (bot)
b55c40419e
[3.12] gh-126862: Use Py_ssize_t instead of int when processing the number of super-classes (GH-127523) (#128700)
gh-126862: Use `Py_ssize_t` instead of `int` when processing the number of super-classes  (GH-127523)
(cherry picked from commit 2fcdc8488c)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-10 03:51:45 +00:00
Miss Islington (bot)
8bfc68f0f5
[3.12] gh-124433: fix docs for asyncio.Queue.task_done (GH-128669) (#128672)
gh-124433: fix docs for `asyncio.Queue.task_done` (GH-128669)
(cherry picked from commit 4322a318ea)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-09 12:28:15 +00:00
Miss Islington (bot)
182234f5ea
[3.12] gh-126137: improve docs for loop.add_reader and loop.add_writer (GH-128666) (#128668)
gh-126137: improve docs for `loop.add_reader` and `loop.add_writer` (GH-128666)
(cherry picked from commit b2adf55674)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-09 10:18:23 +00:00
Miss Islington (bot)
a784cdf6e7
[3.12] gh-79149: document reentrant safety of loop.call_soon_threadsafe (GH-128662) (#128665)
gh-79149: document reentrant safety of `loop.call_soon_threadsafe` (GH-128662)
(cherry picked from commit 4685401845)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-01-09 09:26:40 +00:00
Miss Islington (bot)
4c130c9238
[3.12] gh-128615: Cover pickling of ParamSpecArgs and ParamSpecKwargs (GH-128616) (#128626)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-01-08 12:25:59 +00:00
Miss Islington (bot)
b69b9da9b5
[3.12] gh-41872: Fix quick extraction of module docstrings from a file in pydoc (GH-127520) (GH-128621)
It now supports docstrings with single quotes, escape sequences,
raw string literals, and other Python syntax.

(cherry picked from commit 474e419792)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-01-08 14:21:30 +02:00
Miss Islington (bot)
d8890fb82d
[3.12] gh-128613: Increase typing.Concatenate coverage (GH-128614) (#128624)
gh-128613: Increase `typing.Concatenate` coverage (GH-128614)
(cherry picked from commit eb26e17069)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-01-08 12:20:00 +00:00
Miss Islington (bot)
e903b8ad13
[3.12] gh-87506: Document that json.load*() can raise UnicodeDecodeError (GH-127355) (#128608)
(cherry picked from commit 15372d0112)
(cherry picked from commit cdfb8bc93a)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
Co-authored-by: Erlend Aasland <erlend@python.org>
2025-01-08 08:51:19 +00:00
Erlend E. Aasland
b46addafb1
[3.12] gh-123085: Remove double 'import os' added by PR #124021 (#128600)
gh-123085: Remove double 'import os' added by PR #124021
2025-01-07 19:23:17 -05:00
Erlend E. Aasland
6b3371914c
[3.12] gh-127614: Correctly check for ttyname_r() in configure (#128503) (#128599)
(cherry picked from commit e08b28235a)

PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.
2025-01-07 22:05:42 +00:00
Miss Islington (bot)
82b061d711
[3.12] Docs: mark up json.load() using parameter list (GH-128488) (#128597)
(cherry picked from commit a21e31ec54)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-01-07 21:14:50 +00:00
Miss Islington (bot)
dae5b16bb3
[3.12] gh-98188: Fix EmailMessage.get_payload to decode data when CTE value has extra text (GH-127547) (#128529)
gh-98188: Fix EmailMessage.get_payload to decode data when CTE value has extra text (GH-127547)

Up to this point message handling has been very strict with regards to content encoding values: mixed case was accepted, but trailing blanks or other text would cause decoding failure, even if the first token was a valid encoding.  By Postel's Rule we should go ahead and decode as long as we can recognize that first token.  We have not thought of any security or backward compatibility concerns with this fix.

This fix does introduce a new technique/pattern to the Message code: we look to see if the header has a 'cte' attribute, and if so we use that.  This effectively promotes the header API exposed by HeaderRegistry to an API that any header parser "should" support.  This seems like a reasonable thing to do.  It is not, however, a requirement, as the string value of the header is still used if there is no cte attribute.

The full fix (ignore any trailing blanks or blank-separated trailing text) applies only to the non-compat32 API.  compat32 is only fixed to the extent that it now ignores trailing spaces.  Note that the HeaderRegistry parsing still records a HeaderDefect if there is extra text.

(cherry picked from commit a62ba52f14)

Co-authored-by: RanKKI <hliu86.me@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-07 12:44:56 -05:00
Miss Islington (bot)
e758eb3018
[3.12] gh-123085: _compile_importlib: Avoid copying sources before compilation (GH-124131) (GH-128581)
gh-123085: _compile_importlib: Avoid copying sources before compilation (GH-124131)
(cherry picked from commit 42c8b0556c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2025-01-07 12:28:03 +01:00
Miss Islington (bot)
adddbc3de9
[3.12] gh-108202: Document calendar.Calendar.firstweekday (GH-128566) (#128580)
(cherry picked from commit b3cbd8f1b5)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-01-07 08:06:52 +00:00
Miss Islington (bot)
115d5043b1
[3.12] gh-128472: Add -skip-funcs to BOLT options to fix computed goto errors (gh-128511) (gh-128572)
gh-128472: Add `-skip-funcs` to BOLT options to fix computed goto errors (gh-128511)

* Add `-skip-funcs` to BOLT options to fix computed goto errors



* NEWS

---------

(cherry picked from commit 24b147a19b)

Co-authored-by: Zanie Blue <contact@zanie.dev>
Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
2025-01-07 14:21:43 +09:00
Miss Islington (bot)
fb8bb36f56
[3.12] gh-108202: Document calendar.Calendar methods getfirstweekday and setfirstweekday (GH-127579) (#128565)
(cherry picked from commit 953b49e546)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-01-06 23:46:16 +00:00
Miss Islington (bot)
8788a9570f
[3.12] gh-90241: Clarify documentation for PyUnicode_FSConverter and PyUnicode_FSDecoder (GH-128451) (GH-128543)
(cherry picked from commit 657d7b77e5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2025-01-06 23:20:55 +02:00
Miss Islington (bot)
498da39b0d
[3.12] gh-77214: Update outdated documentation for numeric PyArg_Parse formats (GH-128454) (GH-128539)
(cherry picked from commit 8d15058d61)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-01-06 10:57:26 +00:00
Miss Islington (bot)
8ba72caf26
[3.12] gh-114990: Add missing mixin methods in collections.abc's document (GH-114991) (#128536)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2025-01-06 10:04:57 +00:00
Miss Islington (bot)
f9aac4a76d
[3.12] gh-128519: Align the docstring of untokenize() to match the docs (GH-128521) (#128532)
(cherry picked from commit aef52ca8b3)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-06 08:59:24 +00:00
Miss Islington (bot)
4016be2775
[3.12] Docs: fix MessageDefect references in email.policy docs (GH-128468) (#128527)
(cherry picked from commit 3b231be8f0)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-01-05 22:05:48 +00:00
Jason R. Coombs
d712ece43f
[3.12] gh-123085: Fix issue in inferred caller when resources package has no source (GH-123102) (#124021)
gh-123085: Fix issue in inferred caller when resources package has no source.

From importlib_resources 6.4.3 (python/importlib_resourcesGH-314).
(cherry picked from commit a53812df12)
2025-01-05 16:53:55 -05:00
Miss Islington (bot)
09f7d88cad
[3.12] gh-128504: Upgrade doctest to ubuntu-24.04 (GH-128506) (#128518)
gh-128504: Upgrade doctest to ubuntu-24.04 (GH-128506)
(cherry picked from commit 2228e92da3)

Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-01-05 15:58:02 +02:00