gh-129502: Fix handling errors in ctypes callbacks (GH-129504)
Unlikely errors in preparing arguments for ctypes callback are now
handled in the same way as errors raised in the callback of in converting
the result of the callback -- using sys.unraisablehook() instead of
sys.excepthook() and not setting sys.last_exc and other variables.
(cherry picked from commit 9d63ae5fe5)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-128696: Add arm64 to the get_platform return val description (GH-128701)
(cherry picked from commit 553cdc6d68)
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
gh-129407: Clarify that a `SystemError` isn't always CPython's fault (GH-129410)
(cherry picked from commit 39b754a359)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-127975: Avoid reusing quote types in ast.unparse if not needed (GH-127980)
(cherry picked from commit 8df5193d37)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* Do not recreate unnamed section on every read in ConfigParser
* Remove duplicate section creation code
(cherry picked from commit 914c232e93)
Co-authored-by: Andrey Efremov <duxus@yandex.ru>
gh-115514: Fix incomplete writes after close while using ssl in asyncio(GH-128037)
(cherry picked from commit 4e38eeafe2)
Co-authored-by: Vojtěch Boček <vbocek@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
gh-105704: Disallow square brackets (`[` and `]`) in domain names for parsed URLs (GH-129418)
* gh-105704: Disallow square brackets ( and ) in domain names for parsed URLs
* Use Sphinx references
* Add mismatched bracket test cases, fix news format
* Add more test coverage for ports
---------
(cherry picked from commit d89a5f6a6e)
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-119461: Restore the testSocket VSOCK skipUnless removed by PR GH-119465 (GH-129561)
Restore the skipUnless removed by GH-119465.
This test can only pass on virtual machines, not actual machines.
actual machines see:
```
self.cli.connect((cid, VSOCKPORT))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 19] No such device
```
Reproduced on (Linux) Ubuntu 24.04.1 running 6.8.0-52-generic.
(cherry picked from commit e1006ce1de)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-129438: Update ``--enable-experimental-jit`` section with install requirements (GH-129450)
Add a note to the `JIT` docs that building CPython with `JIT` requires Python 3.11 or newer.
(cherry picked from commit 652f66ac38)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
gh-129403: Fix `ValueError` messages in `asyncio.Barrier` and `threading.Barrier` (GH-129419)
(cherry picked from commit bcb25d60b1)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
remove type annotations from multiprocessing. (GH-129381)
* remove type annotations from multiprocessing.
One of them was technically invalid per typing specs... but since we're not
checking these in the stdlib today lets elide them.
https://discuss.python.org/t/static-type-annotations-in-cpython/65068/13
* use the actual comment style annotation format
---------
(cherry picked from commit 71aecc284e)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
gh-118761: Improve import time of `subprocess` (GH-129427)
* subprocess: lazy import signal and locale to improve module import time
(cherry picked from commit 49f24650e4)
Co-authored-by: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
gh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in CSV file (GH-129413)
(cherry picked from commit 97b0ef05d9)
Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
gh-129408: http: Fix typo 'RFF' to RFC' in documentation (GH-129411)
(cherry picked from commit 7dd0a7e52e)
Co-authored-by: Samuel GIFFARD <samuel@giffard.co>
gh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse.read()` (GH-128270)
The parameter `amt` of `HTTPResponse.read()`, which could be a negative integer,
has not been handled before and led to waiting for the connection to close
for `keep-alive connections`. Now, this has been fixed, and passing negative values
to `HTTPResponse().read()` works the same as passing `None` value.
(cherry picked from commit 4d0d24f6e3)
Co-authored-by: Yury Manushkin <manushkin@gmail.com>
GH-124398: Pin LLVM to 18.1.0 for Windows JIT CI (GH-124399)
(cherry picked from commit b4d0d7de0f)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
gh-119511: Fix a potential denial of service in imaplib (GH-119514)
The IMAP4 client could consume an arbitrary amount of memory when trying
to connect to a malicious server, because it read a "literal" data with a
single read(size) call, and BufferedReader.read() allocates the bytes
object of the specified size before reading. Now the IMAP4 client reads data
by chunks, therefore the amount of used memory is limited by the
amount of the data actually been sent by the server.
(cherry picked from commit 735f25c5e3)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-129061: Fix `FORCE_COLOR` and `NO_COLOR` when empty strings (GH-129140)
(cherry picked from commit 9546fe2ef2)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Adds quoting to `android-env.sh` to protect against spaces in paths.
(cherry picked from commit a49225cc66)
Co-authored-by: Zanie Blue <contact@zanie.dev>
gh-123987: Fix NotADirectoryError in NamespaceReader when sentinel present (GH-124018)
(cherry picked from commit b543b32eff)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Filter out the iOS log prefix from testbed runner output.
(cherry picked from commit a58083811a)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
(cherry picked from commit 7907203bc0)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-97850: Remove the mention of removal from `ResourceReader` docs (GH-128602)
Remove the mention of removal from ResourceReader docs
(cherry picked from commit a1284e9797)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
gh-126172: Fix a misleading statement in PYTHON_BASIC_REPL documentation (GH-127203)
Fix a misleading statement in PYTHON_BASIC_REPL documentation.
(cherry picked from commit f18b226492)
Co-authored-by: Michael Kashirin <88917554+mkashirin@users.noreply.github.com>
gh-118878: Pyrepl: show completions menu below the current line (GH-118939)
(cherry picked from commit 29caec62ee)
Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
gh-128330: Terminal control characters should be restored on repl exit (GH-128331)
(cherry picked from commit 0b15d9c0d2)
Co-authored-by: Andy Fiddaman <andy@omnios.org>