Commit graph

54331 commits

Author SHA1 Message Date
Miss Islington (bot)
b836d40269
[3.13] gh-151693: Add curses tests for panels, textpad, and window behavior (GH-151694) (GH-151721)
Add curses tests for panels, textpad, and window behavior

Extend test_curses with behavior-verifying tests that go beyond the
existing smoke tests:

* curses.panel stacking: new_panel/top/bottom/above/below ordering,
  hide/show/hidden, move, replace and userptr round-trip.
* Real-window curses.textpad.Textbox: gather(), edit(), stripspaces,
  insert mode and the Emacs-like editing commands (previously only
  exercised through a MagicMock).
* Window output: addstr cursor advance and addnstr truncation,
  insstr/insnstr shifting without cursor movement, and pad behavior
  (instr, subpad cell sharing, the required 6-argument refresh()).
* Error handling: out-of-range coordinates raising curses.error and
  bad character/string argument types.
(cherry picked from commit b4cfb992ed)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 10:17:22 +00:00
Miss Islington (bot)
8650126189
[3.13] gh-151678: Add tests for tkinter.Text (GH-151681) (GH-151705) (GH-151715)
Cover previously-untested Text methods (indices, content, marks, tags,
undo/redo, dump, embedded images and windows, peers, and geometry) and
the tag, embedded-image and embedded-window configuration options.
(cherry picked from commit 4ac809e10b)
(cherry picked from commit 22c000eeb4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 09:28:36 +00:00
Miss Islington (bot)
6e356cc4a7
[3.13] gh-151678: Add tests for tkinter.Listbox (GH-151686) (GH-151714)
Cover previously-untested Listbox methods in ListboxTest: size, delete,
index resolution, nearest, see, activate, and the selection methods
(selection_set/clear/includes/anchor and their select_* aliases),
including the errors raised for invalid indices.
(cherry picked from commit cf3b3c1148)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 09:27:30 +00:00
Miss Islington (bot)
c0c9920560
[3.13] gh-151678: Add tests for tkinter.Menu (GH-151685) (GH-151711)
Cover previously-untested Menu methods in MenuTest: adding, inserting and
deleting items of every type, index resolution, invoking items, entry x/y
positions, and post/unpost/tk_popup mapping.

Also test per-entry configuration options and the errors raised for
invalid indices, entry types, option names and option values.
(cherry picked from commit ef5c32a40b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 09:23:43 +00:00
Serhiy Storchaka
805830831f
[3.13] gh-151623: Improve curses documentation and docstrings (GH-151625) (GH-151629) (GH-151630)
(cherry picked from commit 015cc42bc2)

Fix errors and clarify the curses, curses.panel and curses.ascii docs
against X/Open Curses and ncurses, and sync the affected docstrings.
(cherry picked from commit 65afcdd8df)
2026-06-18 09:51:51 +00:00
Miss Islington (bot)
2ca9dae148
[3.13] gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (GH-120666) (#151599)
gh-120665: make unittest loaders avoid loading test cases that are abstract base classes (GH-120666)
(cherry picked from commit 5ad3c6dfbf)

Co-authored-by: blhsing <blhsing@gmail.com>
2026-06-17 11:49:23 -04:00
Miss Islington (bot)
733411a219
[3.13] gh-151519: Check effective gid in _test_all_chown_common group-0 guard (GH-151521) (#151551)
gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (GH-151521)

The guard that skips the "chown to gid 0 should fail" assertion used
only `os.getgroups()` (supplementary groups). The kernel also accepts
the effective/filesystem gid for chown, so when a process runs with
egid 0 and a non-zero uid (common in containers and user namespaces),
chown(-1, 0) succeeds and the assertion spuriously fails.

Add an `os.getegid() != 0` check alongside the existing
`0 not in os.getgroups()` guard.
(cherry picked from commit 2ce260033b)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2026-06-16 09:42:16 -07:00
Miss Islington (bot)
c8e60d5897
[3.13] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523) (#151530)
gh-151522: Guard against None transport in slow-socket SSL test (GH-151523)
(cherry picked from commit 11f032f904)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2026-06-15 22:54:53 -07:00
Miss Islington (bot)
502534ed0b
[3.13] gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (GH-148904) (#149637)
* gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (GH-148904)
(cherry picked from commit bc1be4f617)

Co-authored-by: ByteFlow <fakeshadow1337@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

---------

Co-authored-by: ByteFlow <fakeshadow1337@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-15 15:52:47 +02:00
Miss Islington (bot)
ffa440acb4
[3.13] gh-150389: Make perf profiler tests resilient (GH-150437) (GH-151501) (#151503)
[3.14] gh-150389: Make perf profiler tests resilient (GH-150437) (GH-151501)

gh-150389: Make perf profiler tests resilient (GH-150437)

(cherry picked from commit 638754cb85)
(cherry picked from commit d06b473f8f)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-06-15 13:39:52 +00:00
Stan Ulbrych
9cbbb07990
[3.13] gh-77328: Update base64 module RFC references to RFC 4648 (GH-151275) (#151441)
(cherry picked from commit e933987688)
2026-06-13 13:27:27 +00:00
Miss Islington (bot)
c606d1518c
[3.13] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268) (GH-151431) (#151435)
[3.14] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268) (GH-151431)

* gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268)
(cherry picked from commit 3c00ebc2bb)




(cherry picked from commit 4e8c9c6a57)

* Drop the abrupt-exit-code reporting from the 3.14 backport

Reporting the exit codes of processes that died without a known cause
is a new feature, not part of the gh-101267 bugfix. Keep only the
bugfix on 3.14: each failed future gets its own BrokenProcessPool
exception instead of one shared instance.

---------
(cherry picked from commit 27ff2c8c53)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Daniel Shields <daniel.shields@twosigma.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-06-13 02:37:19 -07:00
Miss Islington (bot)
5bc20725e2
[3.13] gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007) (#151374)
gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007)

And add tests.
(cherry picked from commit 402668b2b1)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 17:39:04 +00:00
Miss Islington (bot)
8b20bedaf5
[3.13] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) (GH-151333)
(cherry picked from commit 0066fd73a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-11 18:02:38 +03:00
Hugo van Kemenade
06dce35b5a
[3.13] gh-130796: Undeprecate locale.getdefaultlocale() (GH-143069) (#151318)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 14:34:40 +03:00
Miss Islington (bot)
003db2ffd0
[3.13] gh-151284: Fix test_capi on UBSan (GH-151286) (#151325)
gh-151284: Fix test_capi on UBSan (GH-151286)

Comment two checks relying on undefined behavior in
test_fromwidechar() of test_capi.

Enable test_capi in GitHub Action "Reusable Sanitizer".
(cherry picked from commit d87d772873)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 11:19:54 +00:00
Serhiy Storchaka
f1c8176636
[3.13] gh-150285: Fix merging error in GH-150458 (GH-151320) 2026-06-11 14:06:27 +03:00
Miss Islington (bot)
5c17ae6c1c
[3.13] gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296) (GH-151306)
(cherry picked from commit 84a322aa15)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2026-06-11 11:30:49 +03:00
Victor Stinner
db9e7556c3
[3.13] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269) (#151283) (#151287)
[3.14][3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269) (#151283)

[3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269)

gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250)

If "import encodings" fails at Python startup, dump the Python path
configuration to help users debugging their configuration. The
encodings module is the first module imported during Python startup.

(cherry picked from commit 7b6e98911e)
(cherry picked from commit 10f616cf39)
(cherry picked from commit b3a7758d8a)
2026-06-10 23:24:46 +02:00
Victor Stinner
87b9729522
[3.13][3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987) (#151251) (#151256)
[3.14] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987) (#151251)

gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987)

Fix crashes in socket.sendmsg() and socket.recvmsg_into() that could
occur if buffer sequences are mutated re-entrantly during argument
parsing via __buffer__ protocol callbacks.

The bug occurs because:

1. PySequence_Fast() returns the original list object when the input
   is already a list (not a copy).
2. During iteration, PyObject_GetBuffer() triggers __buffer__
   callbacks which may clear the list.
3. Subsequent iterations access invalid memory (heap OOB read).

The fix replaces PySequence_Fast() with PySequence_Tuple() which
always creates a new tuple, ensuring the sequence cannot be mutated
during iteration.

(cherry picked from commit 896f7fdc7d)



(cherry picked from commit 632daaf5e9)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2026-06-10 19:04:04 +02:00
Harjoth Khara
4866da0802
[3.13] gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215) (GH-151263) 2026-06-10 17:49:45 +01:00
Thomas Wouters
3a04c62e38 Merge branch '3.13' of https://github.com/python/cpython into 3.13 2026-06-10 18:01:42 +02:00
Miss Islington (bot)
a1f9bd2346
[3.13] gh-150988: Fix refleak in OSError when attrs are set before super().__init__() (GH-150990) (#151242)
gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (GH-150990)
(cherry picked from commit f2a0f82282)

Co-authored-by: Lukas Geiger <lukas.geiger94@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 12:51:12 +00:00
Thomas Wouters
fd17997c38 Python 3.13.14 2026-06-10 14:24:04 +02:00
Serhiy Storchaka
78ed7ff899
[3.13] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) (#151178)
(cherry picked from commit 0fa06f4d7f)
2026-06-09 22:25:09 +02:00
Serhiy Storchaka
52ffdeda1d
[3.13] gh-151130: Add more tests for PyWeakref_* C API (GH-151131) (GH-151141) (#151148)
(cherry picked from commit cb96d5ea4a)


(cherry picked from commit c3cd75afdf)
2026-06-09 22:24:39 +02:00
Abduaziz π
99dc88db09
[3.13] gh-132467: Document and test that generic aliases are not classes (GH-133504) (#151117)
(cherry picked from commit 5915a1fb9d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-06-09 22:24:02 +02:00
Petr Viktorin
743482a87e
[3.13] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149815) (#149848)
[3.14] gh-149231: tomllib: Limit the number of parts in a key (GH-149233) (GH-149815)

(cherry picked from commit bc7c102f34)
(cherry picked from commit 724a5e5e3b)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-09 22:20:07 +02:00
Serhiy Storchaka
bbda3360a4
[3.13] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) (GH-151175) (GH-151185)
(cherry picked from commit e0ad8745c8)
(cherry picked from commit ed2b04248a)
2026-06-09 17:12:18 +00:00
Stan Ulbrych
19bc39127e
[3.13] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368)
Expose the XML Expat 2.7.2 APIs to tune protections against
"billion laughs" [1] attacks.

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and
- `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`.

This completes the work in f04bea44c3,
and improves the existing related documentation.

[1]: https://en.wikipedia.org/wiki/Billion_laughs_attack
(cherry picked from commit 666112376d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-09 15:23:22 +01:00
Miss Islington (bot)
c68571c4bf
[3.13] gh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccurate (GH-109507) (GH-150613)
Nonatomic move might be used even if the files are
on the same filesystem in some cases.
(cherry picked from commit 6ecd197c03)

Co-authored-by: Fang Li <fangli@users.noreply.github.com>
2026-06-09 16:06:55 +03:00
Stan Ulbrych
e7d4c3ff42
[3.13] gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157) (#150949)
Co-authored-by: Seth Larson <seth@python.org>
2026-06-08 20:15:21 +01:00
Stan Ulbrych
8e73feee5c
[3.13] gh-148801: Fix unbound C recursion in Element.__deepcopy__() (GH-148802) (#148843) 2026-06-08 20:14:48 +01:00
Miss Islington (bot)
4834b45ee7
[3.13] gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634) (GH-151102)
(cherry picked from commit 54de5475cd)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-06-08 18:55:43 +00:00
Miss Islington (bot)
947aa707c1
[3.13] gh-150368: Change Windows user group to secure identifier in test_tempfile (GH-150369) (#150703)
gh-150368: Change Windows user group to secure identifier in test_tempfile (GH-150369)
(cherry picked from commit 9d64c355b5)

Co-authored-by: Dawid Konrad Kohnke <51542233+anytokin@users.noreply.github.com>
2026-06-08 18:16:44 +00:00
Miss Islington (bot)
cbbddff73a
[3.13] gh-123853: Update locale.windows_locale (GH-123901) (GH-148877)
Update the table of Windows language code identifiers (LCIDs) to
protocol version 16.0 (2024-04-23).
(cherry picked from commit bfe6f9f590)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-08 20:58:00 +03:00
Miss Islington (bot)
2d322c4641
[3.13] gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087) (#151095)
gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087)

Remove references to server.handler_instance. This attribute has been
removed in 2022 by commit 3ae975f1ac.
(cherry picked from commit a9002349cb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-08 17:20:57 +00:00
Miss Islington (bot)
619a12b2e5
[3.13] gh-150599: Prevent bz2 decompressor reuse after errors (GH-150600)
(cherry picked from commit 157a5df8cb)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-08 10:55:32 +01:00
Miss Islington (bot)
ac07245fd3
[3.13] gh-148954: Escape methodname in xmlrpc.client.dumps() to prevent XML injection (GH-148968) (GH-151035)
(cherry picked from commit ab930175e7)

Co-authored-by: Sanyam Kumat <124618873+sanyamk23@users.noreply.github.com>
2026-06-07 10:53:16 +03:00
Miss Islington (bot)
2fa0d4bc5d
[3.13] gh-50948: IDLE: Warn if saving a file will overwrite a newer version (GH-17578) (GH-151028)
(cherry picked from commit 69851a6407)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Guilherme Polo <ggpolo@gmail.com>
Co-authored-by: Priya Pappachan <priyapappachan010@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-07 00:12:20 +03:00
Miss Islington (bot)
73f9188587
[3.13] gh-149835: Use realpath() instead of abspath() in shutil.move() (GH-149986) (GH-151011)
(cherry picked from commit fab449bddb)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-06-06 13:29:32 +03:00
Miss Islington (bot)
68250323fc
[3.13] gh-150913: Fix sqlite3.Blob validation for empty slice assignment (GH-150915) (GH-150925)
ass_subscript_slice() returned early when the computed slice length
was zero, bypassing validation performed for non-empty slices.
(cherry picked from commit fc9c4db130)

Co-authored-by: Jiseok CHOI <jiseok.dev@gmail.com>
2026-06-04 13:59:11 +00:00
Miss Islington (bot)
ba91d8792a
[3.13] gh-91099: fix[imaplib]: call Exception with string instance (GH-31823) (#150809)
* bpo-46943: fix[imaplib]: call Exception with string instance

Adjust the behavior of 'login' to be similar to `authenticate()`,
where self.error is called with a str() instance.
(cherry picked from commit 29805f00a1)

Co-authored-by: Florian Best <spaceone@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2026-06-03 09:12:00 -04:00
Miss Islington (bot)
fa3af11739
[3.13] gh-101913: changed wording of docstring for _parsedate_tz (GH-134446) (#150798)
Fixed incorrect word.
(cherry picked from commit f7e0fb60cf)

Co-authored-by: Gustaf <79180496+gostak-dd@users.noreply.github.com>
Co-authored-by: Gustaf <79180496+GGyll@users.noreply.github.com>
2026-06-02 13:52:09 -04:00
Petr Viktorin
ba785b88ad
[3.13] gh-149079: Fix O(n^2) canonical ordering in unicodedata.normalize() (GH-149080) (#150780)
Replace the insertion sort used for canonical ordering of combining
characters with a hybrid approach: insertion sort for short runs (< 20)
and counting sort for longer runs, reducing worst-case complexity from
O(n^2) to O(n). This prevents denial of service via crafted Unicode
strings with many combining characters in alternating CCC order.
(cherry picked from commit 991224b1e8)

Co-authored-by: Seth Larson <seth@python.org>
Co-authored-by: ch4n3-yoon <ch4n3.yoon@gmail.com>
Co-authored-by: Seokchan Yoon <13852925+ch4n3-yoon@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2026-06-02 16:12:42 +00:00
Victor Stinner
b8ce8a38d1
[3.13] gh-149738: Fix segmentation fault bug in sqllite3 (#149754) (#150770)
gh-149738: Fix segmentation fault bug in sqllite3 (#149754)

Deleting the `row_factory` or `text_factory` attribute is no longer allowed.

(cherry picked from commit 60fdb3192b)

Co-authored-by: Sepehr Rasouli <sepehrrasouli06@gmail.com>
2026-06-02 14:52:30 +02:00
Miss Islington (bot)
542e01c526
[3.13] gh-148508: Add another common pattern for iOS SSL failures to test_ssl (GH-150442) (#150699)
gh-148508: Add another common pattern for iOS SSL failures to test_ssl (GH-150442)

Match also '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'.
(cherry picked from commit 540b3d0a7f)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-06-01 22:19:53 +00:00
Victor Stinner
ff9c8dea8f
[3.13] gh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (#150704) (#150721)
gh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (#150704)

If a subprocess spawned with CREATE_NEW_CONSOLE creation flag fails
with STATUS_DLL_INIT_FAILED return code, skip the test. It's likely a
memory allocation failure in the desktop heap memory which caused the
DLL init failure.

(cherry picked from commit e8034dd841)
2026-06-01 15:44:54 +00:00
Miss Islington (bot)
62bd651d16
[3.13] gh-150685: update bundled pip to 26.1.2 (gh-150686) (gh-150689) 2026-05-31 21:13:21 +01:00
Miss Islington (bot)
b46df7fe42
[3.13] gh-149489: Fix ElementTree serialization to HTML (GH-149490) (GH-150596) (GH-150609)
* The content of elements "xmp", "iframe", "noembed", "noframes",
  and "plaintext" is no longer escaped.
* The "plaintext" element no longer have the closing tag.
(cherry picked from commit c42e6d3f1a)


(cherry picked from commit bcd29e466f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-30 11:16:32 +00:00