gh-144100: Fix crash for POINTER(str) used in ctypes argtypes (GH-144108)
(cherry picked from commit 8f459255eba2b6639f1912e5c5e318a7cdafada1)
Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-144169: Fix three crashes in AST objects with non-str kwargs (GH-144178)
(cherry picked from commit 639c1ad4f1ef5c2409a62fa8ed16e6aa3a6f9ab8)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-142779: Initialize reserved field for proper padding (GH-142780)
The jitdump specification specifies a reserved field for padding.
Initialize it so no garbage data is embedded in the jitdump files.
(cherry picked from commit 77bf4ba732a8736910bd6b7ec5a58b8ee833c95f)
Co-authored-by: stratakis <cstratak@redhat.com>
It does not support an ASCII string.
Also add more tests.
(cherry picked from commit 25a10b60b04ab2fa802409dc6f211cf2ca028a0a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-143513: Remove importlib.abc documentation for removed ABCs (GH-143605)
In 3.11 ResourceReader, Traversable, & TraversableResources moved from importlib.abc to importlib.resources.abc (commit e712a5b277866a71c195f38c1b5d87d9126dba3e).
In 3.12 old import locations were deprecated (commit 71848c960927af801656026203371c41ad139b5a).
In 3.14 backwards-compat support was removed (commit 0751511d24295c39fdf2f5b2255e3fa3d796ce4d).
(cherry picked from commit f8262b84f5b76e45cfea9d73b09657919926850f)
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
Co-authored-by: Brett Cannon <brett@python.org>
[3.14] gh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022)
The check was (fd > 0), should be (fd >= 0).
(cherry picked from commit fa44efa0ef1972ac1e2f66996303154be11f605e)
Co-authored-by: AZero13 <gfunni234@gmail.com>
This ensures they show up as C macros in search and the Sphinx inventory.
(cherry picked from commit fb690c38cafb15e4ccddc52aba37f9470ce201a0)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-141004: Mark up docs of old PyMem macros (GH-143783)
These had a docs-only deprecation notice since the first version of the docs in this repo. Nowadays we call things “soft deprecated” if there's just a note in the docs.
The deprecated directive needs a version, I went with the first one that had the notice (2.0; it's not in 1.6):
- https://docs.python.org/release/2.0/api/memoryInterface.html
- https://docs.python.org/release/1.6/api/memoryInterface.html
Since PEP 445, they are now direct aliases; there are no (additional) binary compatibility concerns over the preferred names.
(cherry picked from commit a009e78b79ec340d9ff0e1a8ad20f8178fd3257f)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-143993: Document ways to disable remote debugging support (GH-143994)
Although PEP 768 mentions how to disable the mechanism of
remote debugging, it is not documented in the Python docs.
This change adds a note on how to disable remote debugging support
in a Python interpreter to the remote debugging how-to.
(cherry picked from commit 0b5f8359c52f8a5ce0fe436cde499553f3b8f5d5)
Co-authored-by: Rafael Weingartner-Ortner <38643099+RafaelWO@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-143874: Use self.message instead of raw print in `_exec_in_closure()` (GH-143875)
(cherry picked from commit e66597d6c84a8615340822b8da564e5ca3fba5cd)
Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
Update struct.__doc__: _Bool available unconditionally (GH-143716)
This amends commit a9296e7f3be4d6c22271b25c86467ff867c63bbb.
(cherry picked from commit 31c81ab0a2fb7009a76426617991a9b539ab0180)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
gh-143774 - Improve IDLE Format Paragraph doc (GH-143775)
Add a reminder to not rewrap code line to the Menu => Format => Reformat Paragraph entry.
In Editing and Nagivagion, add a new 'Format block' subsection that defines 'paragraph'
to better match what is dependably handled as more or less expected.
In particular, specify equal indents and that the resulting indent equals original indent.
Also mention that selections are expanded to complete lines and how to modify max length.
(Also fix a couple case errors in cross references.)
(cherry picked from commit fa3abf5a51d42b2d62e1bc89e9465b398a567e94)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-102809: No longer mention `Misc/gdbinit` in the code (GH-143980)
Fix misleading comment on `PyObject_Dump`.
(cherry picked from commit f84ea1107170988742fbd350123678a5c503c1ad)
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Use more relevant terminology instead of "master"/"slave" widgets where possible.
(cherry picked from commit 813fc7a291c98654c27f2b5d8f9afa8e53b066a6)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-143916: Reject control characters in wsgiref.headers.Headers (GH-143917)
* Add 'test.support' fixture for C0 control characters
* gh-143916: Reject control characters in wsgiref.headers.Headers
(cherry picked from commit f7fceed79ca1bceae8dbe5ba5bc8928564da7211)
Co-authored-by: Seth Michael Larson <seth@python.org>
gh-143674: Document F/D complex format characters in struct module (GH-143675)
Add documentation for the F (complex from two floats) and D (complex
from two doubles) format characters in the struct module docstring.
These format characters were implemented but not documented.
(cherry picked from commit 3e932257980be8907698c378c23026e262ba066c)
Co-authored-by: Muneeb Ullah <moneebullah25@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This allows to run Tkinter tests with the specified value of
tkinter.wantobjects, for example "-u wantobjects=0".
(cherry picked from commit 21ed1e2a9401a2e96ccc910fcb66f22afc96efbd)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-143880: Fix data race in `functools.partial` in free threading build
The assignment to `pto->vectorcall` isn't thread-safe in the free
threading build. Note that this is already fixed in the main branch.
Add tests for negative offset, out of bound offset, invalid type of offset,
non-writeable buffer, non-continuous buffer, invalid type of buffer.
Repeat all tests for struct.Struct.pack_into().
(cherry picked from commit 66680f1230e51b8274279964f8d2278d12285eb3)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629)
Fix an inconsistency issue in io.BytesIO.write() where the buffer was exported
twice, which could lead to unexpected data overwrites and position drift when
the buffer changes between exports.
(cherry picked from commit c461aa99e2fabbaf5859c0a8a93e08306ee8115d)
Co-authored-by: zhong <60600792+superboy-zjc@users.noreply.github.com>
The behaviour of Cut in nested parentheses, Repeat, Opt, and similar
is somewhat chaotic. Apparently even the academic papers on PEG aren't
as clear as they could be.
And it doesn't really matter. Python only uses top-level cuts.
When that changes, we can clarify as much as necessary (and even
change the implementation to make sense for what we'll need).
Document that this is deliberately unspecified, and add a test to
make sure any decision is deliberate, tested and documented.
(cherry picked from commit f0a0467c176e245a8fd45d4480a0876d748d7e78)
Co-authored-by: Petr Viktorin <encukou@gmail.com>