Commit graph

123131 commits

Author SHA1 Message Date
Miss Islington (bot)
44ba11a204
[3.13] gh-124642: Dictionaries aren't marking objects as weakref'd (GH-124643) (#124798)
gh-124642: Dictionaries aren't marking objects as weakref'd (GH-124643)

Dictionaries aren't marking objects as weakref'd
(cherry picked from commit 077e7ef6a0)

Co-authored-by: Dino Viehland <dinoviehland@meta.com>
2024-09-30 13:51:24 -07:00
Miss Islington (bot)
fe58596cce
[3.13] Doc: Fix default `latex_elements['papersize']` (GH-124525) (#124725)
Doc: Fix default ``latex_elements['papersize']`` (GH-124525)

https://www.sphinx-doc.org/en/master/latex.htmlGH-the-latex-elements-configuration-setting

It should be 'letterpaper' or 'a4paper' not 'letter' or 'a4'
(not to be confused with PAPER env variable).
(cherry picked from commit fae5058ec1)

Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com>
2024-09-29 21:23:06 -07:00
Miss Islington (bot)
243db20b75
[3.13] gh-123811: test that round() can return signed zero (GH-123829) (#123938)
gh-123811: test that round() can return signed zero (GH-123829)
(cherry picked from commit d2b9b6f919)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-29 21:22:13 -07:00
Serhiy Storchaka
5bf32d1300
[3.13] gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes (GH-123613) (#124735)
* Setting the __module__ attribute for a class now removes the
  __firstlineno__ item from the type's dict.
* The _collections_abc and _pydecimal modules now completely replace the
  collections.abc and decimal modules after importing them. This
  allows to get the source of classes and functions defined in these
  modules.
* inspect.findsource() now checks whether the first line number for a
  class is out of bound.
(cherry picked from commit 69a4063ca5)
2024-09-29 21:21:40 -07:00
Miss Islington (bot)
ce0eaa6703
[3.13] gh-124722: Fix leak in test_detach_materialized_dict_no_memory (GH-124769) (#124777)
gh-124722: Fix leak in `test_detach_materialized_dict_no_memory` (GH-124769)
(cherry picked from commit 6f4d64b048)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-29 21:18:24 -07:00
Miss Islington (bot)
a1a4cfcc8e
[3.13] gh-123826: Fix unused function warnings in mimalloc on NetBSD (GH-123827) (#123875)
gh-123826: Fix unused function warnings in mimalloc on NetBSD (GH-123827)
(cherry picked from commit 4a6b1f1796)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-09-30 01:58:09 +00:00
Sergey B Kirpichev
62e54ddc05
[3.13] gh-121039: add Floats/ComplexesAreIdenticalMixin to test.support.testcase (GH-121071) (#123840)
* [3.13] gh-121039: add Floats/ComplexesAreIdenticalMixin to test.support.testcase (GH-121071)
(cherry picked from commit 8ef8354ef1)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>

* +1
2024-09-29 18:27:23 -07:00
Miss Islington (bot)
25a23cb002
[3.13] gh-123823: Fix test_posix for unsupported posix_fallocate on NetBSD (GH-123824) (#123864)
gh-123823: Fix test_posix for unsupported posix_fallocate on NetBSD (GH-123824)

Fix test_posix for unsupported posix_fallocate on NetBSD.
(cherry picked from commit df4f0cbfad)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-09-29 18:26:50 -07:00
Miss Islington (bot)
3fd3b8a678
[3.13] gh-123915: Ensure that Windows AMD64 and ARM64 release builds use different directories (GH-123918) (#123921)
gh-123915: Ensure that Windows AMD64 and ARM64 release builds use different directories (GH-123918)
(cherry picked from commit 00ffdf2736)

Co-authored-by: adang1345 <adang1345@gmail.com>
2024-09-29 18:25:09 -07:00
Miss Islington (bot)
612e469624
[3.13] gh-123892: Add "_wmi" to sys.stdlib_module_names (GH-123893) (#123896)
gh-123892: Add "_wmi" to sys.stdlib_module_names (GH-123893)
(cherry picked from commit fb1b51a58d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-29 18:24:55 -07:00
Miss Islington (bot)
601ef402fd
[3.13] gh-123881: Add additional test coverage for PEP 695 edge cases (GH-123886) (#123890)
gh-123881: Add additional test coverage for PEP 695 edge cases (GH-123886)
(cherry picked from commit b52de7e02d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-29 18:24:40 -07:00
Miss Islington (bot)
4c3d537531
[3.13] gh-77894: Fix a crash when the GC breaks a loop containing a memoryview (GH-123898) (#123936)
gh-77894: Fix a crash when the GC breaks a loop containing a memoryview (GH-123898)

Now a memoryview object can only be cleared if there are no buffers
that refer it.
(cherry picked from commit a1dbf2ea69)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-29 18:23:42 -07:00
Miss Islington (bot)
8b9bd43d40
[3.13] gh-123919: Fix null handling in _freeze_module.c (GH-123920) (#123948)
gh-123919: Fix null handling in `_freeze_module.c` (GH-123920)
(cherry picked from commit c8d1dbef5b)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-29 18:22:15 -07:00
Miss Islington (bot)
793cb77f55
[3.13] gh-123942: add missing test for docstring-handling code in ast_opt.c (GH-123943) (#123955)
gh-123942: add missing test for docstring-handling code in ast_opt.c (GH-123943)
(cherry picked from commit 6e23c89fcd)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-29 18:21:57 -07:00
Miss Islington (bot)
40b27d0455
[3.13] gh-121735: Fix module-adjacent references in zip files (GH-123037) (#123986)
* gh-121735: Fix module-adjacent references in zip files (GH-123037)

* gh-116608: Apply style and compatibility changes from importlib_metadata.

* gh-121735: Ensure module-adjacent resources are loadable from a zipfile.

* gh-121735: Allow all modules to be processed by the ZipReader.

* Add blurb

* Remove update-zips script, unneeded.

* Remove unnecessary references to removed static fixtures.

* Remove zipdata fixtures, unused.
(cherry picked from commit ba687d9481)

* gh-123994: Generate utf-16 file using little endian and BOM. (#123995)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-09-29 18:17:16 -07:00
Miss Islington (bot)
d002e1f3d5
[3.13] gh-116622: Mock the passage of time in Android logcat rate limit tests (GH-124015) (#124035)
gh-116622: Mock the passage of time in Android logcat rate limit tests (GH-124015)

Mock the passage of time in Android logcat rate limit tests

(cherry picked from commit f554883425)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-09-29 18:15:16 -07:00
Miss Islington (bot)
5e2711775e
[3.13] gh-123836: Check zero signs in math_testcases.txt (GH-123854) (#124161)
gh-123836: Check zero signs in math_testcases.txt (GH-123854)

Just like cmath_testcases.txt. These tests require IEEE 754 anyway.

Correct zero sign for sqrt tests to match math.h convention.
(cherry picked from commit 28aea5d07d)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-29 18:14:44 -07:00
Sergey B Kirpichev
99185bd649
[3.13] gh-123836: workaround fmod(x, y) bug on Windows (GH-124171) (#124187)
Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):
FAIL: testFmod (test.test_math.MathTests.testFmod)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod
    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest
    self.fail("{}: {}".format(name, failure))
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)

Here Windows loose sign of the result; if y is nonzero, the result
should have the same sign as x.

This amends commit 28aea5d07d.
(cherry picked from commit f4dd440210)
2024-09-29 18:14:02 -07:00
Miss Islington (bot)
99dc0893c7
[3.13] gh-122145: Handle an empty AST body when reporting tracebacks (GH-122161) (#124214)
gh-122145: Handle an empty AST body when reporting tracebacks (GH-122161)
(cherry picked from commit 5cd50cb6eb)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-29 18:13:36 -07:00
Miss Islington (bot)
5dcce94e9d
[3.13] gh-124064: Fix -Wconversion warnings in Parser/string_parser.c (GH-124204) (#124216)
gh-124064: Fix -Wconversion warnings in Parser/string_parser.c (GH-124204)

Fix integer overflow check in decode_unicode_with_escapes(): use
PY_SSIZE_T_MAX instead of SIZE_MAX.
(cherry picked from commit f9fa6ba4f8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-29 18:13:13 -07:00
Miss Islington (bot)
32acfdb678
[3.13] gh-124212: Fix undefined variable in error message in venv (GH-124211) (#124226)
gh-124212: Fix undefined variable in error message in venv (GH-124211)
(cherry picked from commit ea7fe1fe2e)

Co-authored-by: Jacek <jacek.duszenko@gmail.com>
2024-09-29 18:11:22 -07:00
Miss Islington (bot)
0a868db982
[3.13] gh-123934: Fix MagicMock not to reset magic method return values (GH-124038) (#124231)
gh-123934: Fix `MagicMock` not to reset magic method return values (GH-124038)
(cherry picked from commit 7628f67d55)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-29 18:11:03 -07:00
Miss Islington (bot)
dceac5b8ea
[3.13] gh-124245: Fix UserWarning in test_argparse (GH-124246) (#124255)
gh-124245: Fix UserWarning in test_argparse (GH-124246)
(cherry picked from commit 992e8f6102)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-29 18:07:04 -07:00
Miss Islington (bot)
dbfc37a5f8
[3.13] gh-123797: Check for runtime availability of ptsname_r on macos (GH-123806) (#124270)
gh-123797: Check for runtime availability of `ptsname_r` on macos (GH-123806)
(cherry picked from commit 3e36e5aef1)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-29 18:06:53 -07:00
Miss Islington (bot)
dddae6647e
[3.13] gh-124248: Fix crash in struct when processing 0p fields (GH-124251) (#124277)
gh-124248: Fix crash in struct when processing 0p fields (GH-124251)
(cherry picked from commit 63f196090f)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-09-29 18:06:32 -07:00
Miss Islington (bot)
7f101dcfeb
[3.13] gh-124254: Detect freethreaded MSI component when doing an upgrade on Windows (GH-124279) (#124347)
gh-124254: Detect freethreaded MSI component when doing an upgrade on Windows (GH-124279)
(cherry picked from commit df7228ce14)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-09-29 18:06:11 -07:00
Miss Islington (bot)
8d3a0fecbe
[3.13] GH-87041: Fix incorrect indentation in argparse help (GH-124230) (#124373)
GH-87041: Fix incorrect indentation in argparse help (GH-124230)

In case of usage a long command along with max_help_position more than
the length of the command, the command's help was incorrectly started
on the new line.

(cherry picked from commit 7ee9921734)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Pavel Ditenbir <pavel.ditenbir@gmail.com>
2024-09-29 18:05:51 -07:00
Alex Waygood
67aa68f1b4
[3.13] Bump Ruff to 0.6.7 (#124384) (#124389)
Bump Ruff to 0.6.7 (#124384)
2024-09-29 18:04:56 -07:00
Miss Islington (bot)
6425443e1d
[3.13] bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667) (#124506)
bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667)

Call _() on literal strings only.
(cherry picked from commit d3c76dff44)

Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
2024-09-29 18:03:29 -07:00
Miss Islington (bot)
0a57fe3a7d
[3.13] gh-116622: Make test_unzip_zipfile recognize Android error message format (GH-124462) (#124516)
gh-116622: Make test_unzip_zipfile recognize Android error message format (GH-124462)

Make test_unzip_zipfile recognize Android error message format
(cherry picked from commit 461c12b438)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-09-29 18:03:12 -07:00
Miss Islington (bot)
62f691f3d1
[3.13] gh-124513: Check args in framelocalsproxy_new() (GH-124515) (#124539)
gh-124513: Check args in framelocalsproxy_new() (GH-124515)

Fix a crash in FrameLocalsProxy constructor: check the number of
arguments.
(cherry picked from commit d6954b6421)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-29 18:03:00 -07:00
Miss Islington (bot)
c7f9332ee5
[3.13] gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124542) (#124544)
gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124542)
(cherry picked from commit fb6bd31cb7)

Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Marc Culler <culler@users.noreply.github.com>
2024-09-29 18:02:42 -07:00
Miss Islington (bot)
e20505cb41
[3.13] gh-124498: Fix TypeAliasType not to be generic, when type_params=() (GH-124499) (#124603)
gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (GH-124499)
(cherry picked from commit abe5f799e6)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-09-29 18:01:06 -07:00
Bénédikt Tran
6b847be207
[3.13] gh-89683: add tests for deepcopy on frozen dataclasses (GH-123098) (#124678)
* gh-89683: add tests for `deepcopy` on frozen dataclasses (gh-123098)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2024-09-29 18:00:42 -07:00
Miss Islington (bot)
e8980b17bb
[3.13] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#124719)
gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386)
(cherry picked from commit 425587a110)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-09-29 17:59:54 -07:00
Miss Islington (bot)
f8e3de8c7d
[3.13] docs: improve venv docs (GH-124540) (#124727)
docs: improve venv docs (GH-124540)

- Move "versionchanged" notes that apply to the whole class to the
  end of the class docs
- Remove or move notes next to the method list that apply to individual
  methods.
- Mark up parameters using the appropriate syntax
- Do not capitalize "boolean"
- Shorten some text
(cherry picked from commit c976d789a9)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-29 17:58:32 -07:00
Irit Katriel
cebc6f51ee
[3.13] gh-124746: remove assertion on exits having line numbers (#124762)
gh-124746: remove assertion in 3.13
2024-09-29 17:53:47 -07:00
Miss Islington (bot)
e532760f46
[3.13] Docs: improve generic typing.NamedTuple example (GH-124739) (#124764)
Docs: improve generic `typing.NamedTuple` example (GH-124739)
(cherry picked from commit 76fbee642e)

Co-authored-by: CBerJun <121291537+CBerJun@users.noreply.github.com>
2024-09-29 17:53:13 -07:00
Miss Islington (bot)
7c7e01c2a1
[3.13] gh-124720: Update "Using Python on a Mac" document (GH-124721) (#124775)
gh-124720: Update "Using Python on a Mac" document (GH-124721)

Update "Using Python on a Mac" section of the "Python Setup and Usage"
document and include information on installing free-threading support.
(cherry picked from commit 4b83c03ce9)

Co-authored-by: Ned Deily <nad@python.org>
2024-09-29 17:52:31 -07:00
Miss Islington (bot)
80de9766f7
[3.13] GH-124547: Clear instance dictionary if memory error occurs during object dealloc (GH-124627) (#124714)
GH-124547: Clear instance dictionary if memory error occurs during object dealloc (GH-124627)
(cherry picked from commit 0e21cc6cf8)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2024-09-27 15:23:39 -07:00
Emily Morehouse
0a125d9029
[3.13] gh-81263: Add assignment expressions to help (GH-124641) (#124713)
gh-81263: Add assignment expressions to `help` (#124641)

* Add assignment expression (:=) to `help`

* Update index for Assignment Expressions to include pair of `assignment; expression`
2024-09-27 15:21:58 -07:00
Miss Islington (bot)
5c5f02753a
[3.13] doc: PyUnicode_AsUTF8String() fails if string contains surrogates (GH-124605) (#124707)
doc: PyUnicode_AsUTF8String() fails if string contains surrogates (GH-124605)
(cherry picked from commit d8cf587dc7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-27 15:20:44 -07:00
Miss Islington (bot)
4a58bdb49e
[3.13] gh-120104: IDLE: Fix padding in config and search dialogs (GH-120107) (#122740)
gh-120104: IDLE: Fix padding in config and search dialogs (GH-120107)
(cherry picked from commit 4b66b6b7d6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-27 15:19:56 -07:00
Terry Jan Reedy
2df77c8daf
[3.13] Backport idlelib typos (#124325)
See #123597.  The typo in Icon/README.txt was fixed
in the unmerged 3.13 backport #123608 of the
PR that added the text with the typo.

(cherry picked from commit 1f4a49e)

Co-authored-by: abstractee
2024-09-27 15:19:44 -07:00
Miss Islington (bot)
845e039999
[3.13] gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310) (#124318)
gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310)

https://github.com/python/cpython/issues/88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS.  While theoretically correct, the result was Shell freezing when receiving continuous short strings to print.  Test: `while 1: 1`.

The guess is that there is no idle time in which to do the screen update.  Reverting the change in one of the files,
outwin, fixes the issue.  Colorizer runs ever 1/20 second and seems to work fine.

When running test-outwin on macOS, alias 'update'
to 'update_idletasks on the text used for testing.
(cherry picked from commit d5f95ec07b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-09-27 15:19:28 -07:00
Miss Islington (bot)
2b74cce521
[3.13] gh-90190: Add doc for using singledispatch with precise collection type hints (GH-116544) (#124710)
gh-90190: Add doc for using `singledispatch` with precise collection type hints (GH-116544)
(cherry picked from commit 2357d5ba48)

Co-authored-by: Matt Delengowski <matt.delengowski@gmail.com>
2024-09-27 21:28:30 +00:00
Miss Islington (bot)
ec4d7b5d22
[3.13] gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546) (#124708)
gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546)
(cherry picked from commit 3387f76b8f)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-09-27 14:23:16 -07:00
Miss Islington (bot)
09aecb66df
[3.13] gh-124487: Update Windows API version to Windows 8.1 (GH-124676) (#124702)
gh-124487: Update Windows API version to Windows 8.1 (GH-124676)
(cherry picked from commit a4916e6013)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-09-27 19:59:26 +00:00
Miss Islington (bot)
4618c0e5e6
[3.13] gh-124609: Fix _Py_ThreadId for Windows builds using MinGW (GH-124663) (#124698)
gh-124609: Fix _Py_ThreadId for Windows builds using MinGW (GH-124663)
(cherry picked from commit 0881e2d3b1)

Co-authored-by: Tony Roberts <tony@pyxll.com>
2024-09-27 19:58:36 +00:00
Miss Islington (bot)
cf98f39103
[3.13] GH-65961: Document the deprecation of __package__ and __cached__ (GH-124377) (#124380)
* GH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)

The code changes for warning related to `__package__` landed in Python 3.12. `__cached__` doesn't have any changes as it isn't used but only set by the import system.
(cherry picked from commit 67201ad53f)

---------

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Barry Warsaw <barry@python.org>
2024-09-27 18:53:35 +00:00