Commit Graph

29516 Commits

Author SHA1 Message Date
Miss Islington (bot) 67851201d8
[3.13] gh-123572: Fix key codes in VK_MAP in windows_console.py (GH-122692) (#123632)
gh-123572: Fix key codes in VK_MAP in windows_console.py (GH-122692)
(cherry picked from commit 782217f28f)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2024-09-03 15:01:14 +01:00
Miss Islington (bot) 48941399e3
[3.13] gh-121804: always show error location for SyntaxError's in basic repl (GH-123202) (#123631)
gh-121804: always show error location for SyntaxError's in basic repl (GH-123202)
(cherry picked from commit 6822cb23c6)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-03 13:06:31 +00:00
Miss Islington (bot) 7761ddcfed
[3.13] gh-123409: fix `IPv6Address.reverse_pointer` for IPv4-mapped addresses (GH-123419) (#123606)
gh-123409: fix `IPv6Address.reverse_pointer` for IPv4-mapped addresses (GH-123419)

Fix functionality that was broken with better textual representation for IPv4-mapped addresses (gh-87799)
(cherry picked from commit 77a2fb4bf1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-03 01:19:46 +02:00
Miss Islington (bot) 80e0326b53
[3.13] gh-98442: fix locations of with statement's cleanup instructions (GH-120763) (#120786)
gh-98442: fix locations of with statement's cleanup instructions (GH-120763)
(cherry picked from commit 55596ae044)


gh-98442: fix location of with statement's cleanup instructions

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-02 15:46:41 +00:00
Miss Islington (bot) 494181e44d
[3.13] gh-93691: fix too broad source locations of with-statement instructions (GH-120125) (#123604)
gh-93691: fix too broad source locations of with-statement instructions (GH-120125)
(cherry picked from commit eca3f7762c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-02 14:53:39 +00:00
Miss Islington (bot) 3b3a1a8e7e
[3.13] gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572) (#123601)
gh-101525: Skip test_gdb if the binary is relocated by BOLT. (gh-118572)
(cherry picked from commit f95fc4de11)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-09-02 23:10:52 +09:00
Wei-Hsiang (Matt) Wang 05dcc81601
[3.13] gh-123517: Remove unnecessary `:meth:` parentheses (gh-123518) (GH-123577) 2024-09-02 16:00:04 +02:00
Miss Islington (bot) b76a4a5db7
[3.13] gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788) (#122814)
gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788)
(cherry picked from commit 6094c6fc2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-02 12:07:27 +00:00
Miss Islington (bot) ed3a49ea73
[3.13] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123542)
gh-121285: Remove backtracking when parsing tarfile headers (GH-121286)

* Remove backtracking when parsing tarfile headers
* Rewrite PAX header parsing to be stricter
* Optimize parsing of GNU extended sparse headers v0.0

(cherry picked from commit 34ddb64d08)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-09-02 13:19:11 +02:00
Miss Islington (bot) bf0d8bb301
[3.13] gh-108172: do not override OS preferred browser if it is a super-string of a known browser (GH-113011) (#123527)
gh-108172: do not override OS preferred browser if it is a super-string of a known browser (GH-113011)

When checking if the registering browser is the "OS preferred browser", do not use a substring search - that makes no sense: one can have a preferred browser that looks like a super-string of a known browser, e.g. "firefox-nightly" vs "firefox".

https://github.com/python/cpython/issues/108172 explains in more detail, and lays out a potential better future enhancement for this case of just using xdg-open.  We'll go with this for now.

---------

(cherry picked from commit 10bf615bab)

Co-authored-by: Oded Arbel <oded@geek.co.il>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-09-02 13:18:27 +02:00
Wulian 5c408e333d
[3.13] Fix typos in docs and what's new (#123451) 2024-09-02 13:15:02 +02:00
Miss Islington (bot) 7e8883a3f0
[3.13] gh-123270: Replaced SanitizedNames with a more surgical fix. (GH-123354) (#123410)
gh-123270: Replaced SanitizedNames with a more surgical fix. (GH-123354)

Applies changes from zipp 3.20.1 and jaraco/zippGH-124
(cherry picked from commit 2231286d78)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-09-02 13:13:18 +02:00
Miss Islington (bot) b1372e2f1a
[3.13] GH-122298: Restore printing of GC stats (GH-123261) (#123268)
GH-122298: Restore printing of GC stats (GH-123261)
(cherry picked from commit 7cd3aa42f0)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2024-09-02 13:10:27 +02:00
Miss Islington (bot) d9e4c4b61c
[3.13] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214) (#123257)
gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214)
(cherry picked from commit 90b6d0e0f8)

Co-authored-by: Bar Harel <bharel@barharel.com>
2024-09-02 13:10:09 +02:00
Miss Islington (bot) 4ea9c5ba78
[3.13] gh-85110: Preserve relative path in URL without netloc in urllib.parse.urlunsplit() (GH-123179) (#123187)
gh-85110: Preserve relative path in URL without netloc in urllib.parse.urlunsplit() (GH-123179)
(cherry picked from commit 90c892efea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-02 13:09:17 +02:00
Miss Islington (bot) 2b4c31d87d
[3.13] gh-122981: Fix inspect.getsource() for generated classes with Python base classes (GH-123001) (#123182)
gh-122981: Fix inspect.getsource() for generated classes with Python base classes (GH-123001)

Look up __firstlineno__ only in the class' dict, without searching in
base classes.
(cherry picked from commit f88c14d412)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-02 13:07:08 +02:00
Miss Islington (bot) f070398669
[3.13] gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047) (#122786)
gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047)
(cherry picked from commit 0bd93755f3)

Co-authored-by: Lucas Esposito <LucasEsposito@users.noreply.github.com>
2024-09-02 12:58:53 +02:00
Miss Islington (bot) f1a6d2254f
[3.13] gh-121151: argparse: Fix wrapping of long usage text of arguments inside a mutually exclusive groups (GH-121159) (#122777)
gh-121151: argparse: Fix wrapping of long usage text of arguments inside a mutually exclusive groups (GH-121159)
(cherry picked from commit 013a092975)

Co-authored-by: Ali Hamdan <ali.hamdan.dev@gmail.com>
2024-09-02 12:55:16 +02:00
Miss Islington (bot) 8c01b34268
[3.13] gh-79846: Make ssl.create_default_context() ignore invalid certificates (GH-91740) (#122768)
gh-79846: Make ssl.create_default_context() ignore invalid certificates (GH-91740)

An error in one certificate should not cause the whole thing to fail.

(cherry picked from commit 9e551f9b35)

Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-02 12:53:59 +02:00
Miss Islington (bot) 29733b084d
[3.13] gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (GH-120605) (#122739)
gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (GH-120605)

On recent versions of macOS (sometime between Catalina and Sonoma 14.5), the default Hovertip foreground color changed from black to white, thereby matching the background. This might be a matter of matching the white foreground of the dark-mode text. The unreadable result is shown here (GH-120083 (comment)).

The foreground and background colors were made parameters so we can pass different colors for future additional hovertips in IDLE.
---------

(cherry picked from commit 5a7f7c4864)

Co-authored-by: John Riggles <jriggles@icloud.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-09-02 12:50:39 +02:00
Miss Islington (bot) 57ba3b0c6e
[3.13] gh-122527: Fix a crash on deallocation of `PyStructSequence` (GH-122577) (#122625)
gh-122527: Fix a crash on deallocation of `PyStructSequence` (GH-122577)

The `PyStructSequence` destructor would crash if it was deallocated after
its type's dictionary was cleared by the GC, because it couldn't compute
the "real size" of the instance. This could occur with relatively
straightforward code in the free-threaded build or with a reference
cycle involving the type in the default build, due to differing orders
in which `tp_clear()` was called.

Account for the non-sequence fields in `tp_basicsize` and use that,
along with `Py_SIZE()`, to compute the "real" size of a
`PyStructSequence` in the dealloc function. This avoids the accesses to
the type's dictionary during dealloc, which were unsafe.
(cherry picked from commit 4b63cd170e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-09-02 12:47:18 +02:00
Wei-Hsiang (Matt) Wang 9f5f2b7128
[3.13] gh-123492: Remove unnecessary `:func:` parentheses (gh-123493) (#123513) 2024-08-30 20:14:48 +03:00
Miss Islington (bot) 8ef277e5e9
[3.13] gh-123484: Fix the debug offsets for PyLongObject (GH-123485) (#123499) 2024-08-30 12:05:50 +00:00
Miss Islington (bot) bd29ce8509
[3.13] gh-123448: Move `_PyNoDefault_Type` to the static types array (GH-123449) (#123450)
(cherry picked from commit c9930f5022)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-08-28 18:57:28 -07:00
Miss Islington (bot) 19a1f18740
[3.13] gh-123344: Add missing ast optimizations for PEP 696 (GH-123377) (#123427)
(cherry picked from commit be083cee34)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-08-28 14:02:34 +00:00
Malcolm Smith 350313e731
[3.13] gh-119727: Add --single-process option to regrtest (#119728) (#123010)
gh-119727: Add --single-process option to regrtest (#119728)

(cherry picked from commit 4e8aa32245)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-08-26 11:59:26 +02:00
Miss Islington (bot) 865bfb1530
[3.13] gh-123177: Fix prompt for wrapped lines in pyrepl (GH-123324) (#123327)
gh-123177: Fix prompt for wrapped lines in pyrepl (GH-123324)

When display lines above the cursor come from the cache, the first line
to not come from the cache may be a wrapped line, starting half way
through a logical line in the buffer. Detect and handle this case to
avoid accidentally drawing a stray prompt in the middle of a logical
line.
(cherry picked from commit 602fcf97df)

Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
2024-08-26 02:13:36 +01:00
Miss Islington (bot) e37b7f1a9c
[3.13] gh-123177: Deactivate line wrap for Apple Terminal via scape codes in the new REPL (GH-123267) (#123322)
gh-123177: Deactivate line wrap for Apple Terminal via scape codes in the new REPL (GH-123267)
(cherry picked from commit fdb3f9b588)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-08-25 22:01:56 +00:00
Miss Islington (bot) bbed982729
[3.13] gh-123297: Propagate LD_FLAGS to LDCXXSHARED in sysconfig (GH-123298) (#123319)
gh-123297: Propagate LD_FLAGS to LDCXXSHARED in sysconfig (GH-123298)
(cherry picked from commit c535a49e92)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-08-25 20:25:49 +00:00
Miss Islington (bot) abaaaff328
[3.13] gh-122982: Extend the deprecation period for bool inversion by two years (GH-123306) (#123316)
gh-122982: Extend the deprecation period for bool inversion by two years (GH-123306)
(cherry picked from commit 249b083ed8)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-08-25 19:48:34 +00:00
Miss Islington (bot) 391e5626e3
[3.13] gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075) (#123103)
gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075)

This fixes CVE-2024-7592.
(cherry picked from commit 44e458357f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-08-24 15:36:58 -07:00
Miss Islington (bot) 31fae8c94f
[3.13] gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (GH-123281) (#123293)
gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (GH-123281)
(cherry picked from commit ca18ff2a34)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2024-08-24 16:11:17 +00:00
Miss Islington (bot) a65fe07db4
[3.13] gh-123243: Fix reference leak in `_decimal` (GH-123244) (#123280)
gh-123243: Fix reference leak in `_decimal` (GH-123244)
(cherry picked from commit 5ff638f1b5)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2024-08-24 04:33:49 +00:00
Miss Islington (bot) 935b8b422b
[3.13] gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (GH-123263) (#123264)
gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (GH-123263)
(cherry picked from commit adc5190014)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-08-23 12:59:54 +00:00
CF Bolz-Tereick 0955db1bd8
[3.13] gh-82378 fix sys.tracebacklimit in pyrepl, approach 2 (GH-123062) (#123252)
Make sure that pyrepl uses the same logic for sys.tracebacklimit as both
the basic repl and the standard sys.excepthook
(cherry picked from commit 63603bca35)
2024-08-23 12:59:08 +01:00
Miss Islington (bot) 95b4f9c9ad
[3.13] GH-120097: Make FrameLocalsProxy a mapping (GH-120101) (GH-120749)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-08-23 10:26:03 +01:00
CF Bolz-Tereick 30eee22d3f
[3.13] gh-122478: Remove internal frames from tracebacks in REPL (GH-122528) (#123227)
Frames of methods in code and codeop modules was show with non-default
sys.excepthook.

Save correct tracebacks in sys.last_traceback and update __traceback__
attribute of sys.last_value and sys.last_exc.
(cherry picked from commit e73e7a7abd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-08-22 23:58:05 +00:00
Sergey B Kirpichev 5271f8fead
[3.13] gh-122546: use same filename for different exceptions in new repl (GH-123217) (#123226) 2024-08-23 00:28:09 +01:00
Donghee Na 6cd67e413b
[3.13] gh-123083: Fix a potential use-after-free in ``STORE_ATTR_WITH… (#123235)
[3.13] gh-123083: Fix a potential use-after-free in ``STORE_ATTR_WITH_HINT`` (gh-123092)
(cherry picked from commit 297f2e093e)
2024-08-23 01:37:26 +09:00
Irit Katriel e4b91b7256
[3.13] gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (GH-123173). (#123209)
(cherry picked from commit ec89620e5e)
2024-08-22 10:22:39 +01:00
Miss Islington (bot) 159db050f4
[3.13] gh-123048: Fix missing source location in pattern matching code (GH-123167) (#123169)
gh-123048: Fix missing source location in pattern matching code (GH-123167)
(cherry picked from commit bffed80230)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-08-20 11:13:43 +00:00
Sergey B Kirpichev c8f4069ab1
[3.13] gh-121804: Always show error location for SyntaxError's in new repl (GH-121886) (#123148)
(cherry picked from commit 354d55eb1f)
2024-08-19 20:01:58 +01:00
Miss Islington (bot) 21399a0963
[3.13] gh-118658: Return consistent types from `get_un/verified_chain` in `SSLObject` and `SSLSocket` (GH-118669) (#123082)
gh-118658: Return consistent types from `get_un/verified_chain` in `SSLObject` and `SSLSocket` (GH-118669)
(cherry picked from commit 8ef358dae1)

Co-authored-by: Mateusz Nowak <nowak.mateusz@hotmail.com>
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2024-08-19 10:39:28 -05:00
Miss Islington (bot) 0a02026a08
[3.13] gh-123123: Fix display of syntax errors covering multiple lines (GH-123131) (#123147)
gh-123123: Fix display of syntax errors covering multiple lines (GH-123131)
(cherry picked from commit 48856ead6a)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-08-19 15:35:47 +00:00
Miss Islington (bot) 032b6467fa
[3.13] gh-122081: fixed crash in decimal.IEEEContext() (GH-122082) (#123136)
gh-122081: fixed crash in decimal.IEEEContext() (GH-122082)

* gh-122081: fixed crash in decimal.IEEEContext()

Now

$ ./configure CFLAGS=-DEXTRA_FUNCTIONALITY -q && make -s && \
     ./python -m test test_decimal

- PASS

* Apply suggestions from code review



* Update Misc/NEWS.d/next/Library/2024-07-21-10-45-24.gh-issue-122081.dNrYMq.rst

* Apply suggestions from code review

---------

(cherry picked from commit b9e10d1a0f)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-08-19 14:14:11 +05:30
Miss Islington (bot) ff58c3cb48
[3.13] gh-123022: Fix crash with `Py_Initialize` in background thread (GH-123052) (#123114)
Check that the current default heap is initialized in
`_mi_os_get_aligned_hint` and `mi_os_claim_huge_pages`.

The mimalloc function `_mi_os_get_aligned_hint` assumes that there is an
initialized default heap. This is true for our main thread, but not for
background threads. The problematic code path is usually called during
initialization (i.e., `Py_Initialize`), but it may also be called if the
program allocates large amounts of memory in total.

The crash only affected the free-threaded build.
(cherry picked from commit d061ffea7b)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-08-17 20:38:02 +00:00
Miss Islington (bot) 0dd89a7f40
[3.13] gh-116622: Android logging fixes (GH-122698) (#122719)
gh-116622: Android logging fixes (GH-122698)

Modifies the handling of stdout/stderr redirection on Android to accomodate
the rate and buffer size limits imposed by Android's logging infrastructure.
(cherry picked from commit b0c48b8fd8)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-08-16 16:07:42 +08:00
Miss Islington (bot) 69cf92fbca
[3.13] gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522) (#122539)
gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522)

Don't expose `FICLONE` ioctl on Android

(cherry picked from commit 06656e259b)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-08-16 16:07:27 +08:00
Miss Islington (bot) 55aede7342
[3.13] gh-122888: Fix crash on certain calls to str() (GH-122889) (#122947)
Fixes GH-122888
(cherry picked from commit 53ebb6232a)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-08-12 16:53:05 +00:00
Miss Islington (bot) 59d0d335cf
[3.13] gh-122903: Honor directories in zipfile.Path.glob. (GH-122908) (#122926)
(cherry picked from commit 6aa35f3002)
2024-08-12 01:02:10 +00:00