Commit Graph

29491 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 8c7348939d
[3.13] gh-122905: Sanitize names in zipfile.Path. (GH-122906) (#122922) 2024-08-11 20:35:04 -04:00
Miss Islington (bot) 42005c77a0
[3.13] gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (GH-122764) (GH-122842)
gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (GH-122764)

(LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)
(cherry picked from commit 2f5c3b09e4)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-08-09 14:45:04 -07:00
Miss Islington (bot) bcce4cc466
[3.13] gh-105376: Restore deprecated logging warn() method (GH-122775) (#122856)
gh-105376: Restore deprecated logging warn() method (GH-122775)

This reverts commit dcc028d924 and
commit 6c54e5d721.

Keep the deprecated logging warn() method in Python 3.13.

(cherry picked from commit d3239976a8)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-09 17:15:30 +02:00
Peter Bierma e8fb088dba
[3.13] gh-122695: Fix double-free when using `gc.get_referents` with a freed `_asyncio.FutureIter` (#122837)
* Backport #122834 for 3.13
2024-08-09 19:36:36 +05:30
Miss Islington (bot) 862bead237
[3.13] GH-118943: Remove regen-jit from the regen-all make target (GH-122840)
cherry picked from commit 8c9d1742de)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Éric <merwok@netwok.org>
2024-08-08 14:14:49 -07:00
Miss Islington (bot) 27a5292774
[3.13] GH-118943: Handle races when moving jit_stencils.h (GH-122709)
(cherry picked from commit 44659d3927)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-08-08 13:37:49 -07:00
Miss Islington (bot) 84c8cd0f3d
[3.13] gh-87320: In the code module, handle exceptions raised in sys.excepthook (GH-122456) (GH-122514)
Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
(cherry picked from commit bd3d31f380)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
2024-08-08 07:26:52 +00:00
Serhiy Storchaka 1fd1c6c738
[3.13] gh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664) (GH-122806)
Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
(cherry picked from commit 540fcc62f5)
2024-08-08 09:49:21 +03:00
Miss Islington (bot) 5c161cb832
[3.13] gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735) (#122757)
gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735)

Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
(cherry picked from commit 4767a6e31c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-08-06 23:37:10 +02:00
Pradyun Gedam f0e5ebfcd5
[3.13] gh-122744: Bump bundled pip to 24.2 (#122746)
(cherry picked from commit 5b8a6c5186)

Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
2024-08-06 18:50:12 +00:00
Miss Islington (bot) 4aaa4259b5
[3.13] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) (#122484)
gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)

GH-GH- Encode header parts that contain newlines

Per RFC 2047:

> [...] these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.

GH-GH- Verify that email headers are well-formed

This should fail for custom fold() implementations that aren't careful
about newlines.

(cherry picked from commit 0976339818)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-08-06 19:06:41 +02:00
Miss Islington (bot) d5e7d0a468
[3.13] gh-122573: Require Python 3.10 or newer for Windows builds (GH-122574) (#122674)
gh-122573: Require Python 3.10 or newer for Windows builds (GH-122574)

Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).

(cherry picked from commit d0b92dd5ca)

Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-08-06 18:53:12 +02:00
Irit Katriel 545a328eae
[3.13] gh-122445: populate only modified fields in __static_attributes__ (#122446) (#122621)
gh-122445: populate only modified fields in __static_attributes__ (#122446)

(cherry picked from commit 498376d7a7)
2024-08-02 19:26:57 +01:00
Miss Islington (bot) b20893b5c2
[3.13] gh-122334: Fix crash when importing ssl after re-initialization (GH-122481) (#122614)
gh-122334: Fix crash when importing ssl after re-initialization (GH-122481)

* Fix crash when importing ssl after re-initialization
(cherry picked from commit 9fc1c992d6)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2024-08-02 14:07:16 +00:00
Miss Islington (bot) 56435a88c4
[3.13] gh-121723: Relax constraints on queue objects for `logging.handlers.QueueHandler`. (GH-122154) (GH-122603)
(cherry picked from commit fb864c76cd)
2024-08-02 13:07:27 +01:00
Thomas Wouters e4a3e786a5 Python 3.13.0rc1 2024-07-31 20:18:39 +02:00
Petr Viktorin 8c8c43e1dc
[3.13] gh-120906: Support arbitrary hashable keys in FrameLocalsProxy (GH-122309) (#122488)
[3.13] gh-120906: Support arbitrary hashable keys in FrameLocalsProxy  (GH-122309)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
(cherry picked from commit 5912487938)
2024-07-31 09:31:44 +00:00
Miss Islington (bot) 5212624c42
[3.13] gh-116622: Fix testPyObjectPrintOSError on Android (GH-122487) (#122490)
gh-116622: Fix testPyObjectPrintOSError on Android (GH-122487)

Adds extra handling for way BSD/Android return errors from calls to fwrite.
(cherry picked from commit 82db572813)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-07-31 00:49:14 +00:00
Miss Islington (bot) a21317f07b
[3.13] GH-122482: Make About IDLE direct discussion to DPO (GH-122483) (#122485)
Currently, idle-dev@python.org and idle-dev mailing list
serve to collect spam (90+%).  Change About IDLE to direct
discussions to discuss.python.org.  Users are already
doing so.
(cherry picked from commit 29c04dfa27)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-07-30 22:54:01 +00:00
Dino Viehland 11292ab935
[3.13] gh-122208: Don't delivery PyDict_EVENT_ADDED until it can't fail (#122326)
Don't delivery PyDict_EVENT_ADDED until it can't fail
2024-07-30 09:13:31 -07:00
Miss Islington (bot) 202cfbfb7c
[3.13] gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480) (GH-122444)
(cherry picked from commit d27a53fc02)

Co-authored-by: Clinton <pygeek@users.noreply.github.com>
2024-07-30 09:24:35 +00:00
Miss Islington (bot) 466bb0d7ea
[3.13] gh-122400: Handle ValueError in filecmp (GH-122401) (GH-122441)
(cherry picked from commit 3a9b2aae61)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-30 09:17:35 +00:00
Miss Islington (bot) a4c7eb54bd
[3.13] gh-105733: Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it. (GH-122281) (GH-122440)
gh-105733: Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it. (GH-122281)

Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it.

Partially reverts 2211454fe2
(cherry picked from commit 3833d27f98)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-30 08:05:09 +00:00
Miss Islington (bot) b252317956
[3.13] gh-122133: Authenticate socket connection for `socket.socketpair()` fallback (GH-122134) (GH-122424)
Authenticate socket connection for `socket.socketpair()` fallback when the platform does not have a native `socketpair` C API.  We authenticate in-process using `getsocketname` and `getpeername` (thanks to Nathaniel J Smith for that suggestion).

(cherry picked from commit 78df1043db)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-07-30 03:40:02 +00:00
Brandt Bucher 55554fd215
[3.13] GH-116090: Fire RAISE events from _FOR_ITER_TIER_TWO (GH-122419)
(cherry picked from commit 15d4cd0967)
2024-07-29 14:51:19 -07:00