| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433)
Fix potential unaligned memory access on C APIs involving returned sequences
of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These
were revealed using a ``-fsaniziter=alignment`` build on ARM macOS.
(cherry picked from commit f01e4cedba1a17d321664834bb255d9d04ad16ce)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
|
|
|
|
|
|
|
|
| |
(gh-105258) (gh-107303)
The _xxsubinterpreters module was meant to only use public API. Some internal C-API usage snuck in over the last few years (e.g. gh-28969). This fixes that.
(cherry picked from commit e6373c0d8b59512aa7f0dea7f3fb162b6ed10fa4)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
|
| |
(GH-106351) (GH-107258)
(cherry picked from commit b5ae7c498438657a6ba0bf4cc216b9c2c93a06c7)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
|
|
|
|
|
|
|
| |
initializer (GH-106862) (GH-106953)
(cherry picked from commit 8d397ee8259fa0f81598a452438fc335267ca260)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
(GH-106768) (GH-106855)
Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
(cherry picked from commit 3e65baee72131b49f4ce8ca2da568a6f2001ce93)
|
|
|
|
|
|
| |
_curses_panel, _decimal, posix, xxsubtype (GH-106767) (#106849)
(cherry picked from commit 745492355b94d109e47827e5865846f25ae42d26)
|
|
|
|
|
|
|
|
| |
(GH-106832) (#106835)
gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (GH-106832)
(cherry picked from commit ebf2c56b33553a448da8f60fcd89a622f071b5f4)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-106687: _ssl: use uint64_t for SSL options (GH-106700)
SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html
Fix this compiler warning on Windows with MSC:
conversion from 'uint64_t' to 'long', possible loss of data
(cherry picked from commit ad95c7253a70e559e7d3f25d53f4772f28bb8b44)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-105252) (#106708)
gh-105235: Prevent reading outside buffer during mmap.find() (GH-105252)
* Add a special case for s[-m:] == p in _PyBytes_Find
* Add tests for _PyBytes_Find
* Make sure that start <= end in mmap.find
(cherry picked from commit ab86426a3472ab68747815299d390b213793c3d1)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
| |
Add tests for codecs.
(cherry picked from commit 51ea664d18938645521bdd128a3c55f9c197644c)
|
|
|
|
|
|
|
|
|
|
| |
gh-105227: Add PyType_GetDict() (GH-105747)
This compensates for static builtin types having `tp_dict` set to `NULL`.
(cherry picked from commit a840806d338805fe74a9de01081d30da7605a29f)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
|
|
| |
Some items remained uninitialized if _sre.template() was called with invalid
indices. Then attempt to clear them in the destructor led to dereferencing
of uninitialized pointer.
(cherry picked from commit 2ef1dc37f02b08536b677dd23ec51541a60effd7)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(GH-106286) (#106365)
gh-91053: make func watcher tests resilient to other func watchers (GH-106286)
(cherry picked from commit 58906213cc5d8f2be311664766b4923ef29dae1f)
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
|
| |
GH-106152: Add PY_THROW event to cProfile (GH-106161)
(cherry picked from commit cea9d4ea82abcb2c6f1d83a2fe819859da4bbda4)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
|
|
|
|
|
|
|
|
| |
(#106099)
[3.12] gh-105987: Fix reference counting issue in `_asyncio._swap_current_task` (GH-105989).
(cherry picked from commit d2cbb6e918d9ea39f0dd44acb53270f2dac07454)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
(#106041)
[3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034)
These functions are broken by design because they discard any exceptions raised
inside, including MemoryError and KeyboardInterrupt. They should not be
used in new code.
(cherry picked from commit 1d33d5378058671bfabb6f4d4b5bfd4726973ff9)
|
|
|
|
| |
For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
(cherry picked from commit 757b402)
|
|
|
|
|
|
|
|
| |
(gh-105731)
We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
(cherry picked from commit b97e14a806477af4225777d215ac38c0d9b845f0)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
|
|
| |
(#105667) (#105720)
Prevent exceptions from possibly being overwritten in case of multiple
failures.
(cherry picked from commit 217589d4f3246d67c6ef0eb0be2b1c33987cf260)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-105686) (#105710)
All fields must be explicitly initialised to prevent manipulation of
uninitialised fields in dealloc.
Align initialisation order with the layout of the object structs.
(cherry picked from commit ca3cc4b95d66f7527ebe0ba4cdb1907082d9bfc8)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
|
| |
values (GH-105495) (#105700)
gh-105436: The environment block should end with two null wchar_t values (GH-105495)
(cherry picked from commit 4f7d3b602d47d61137e82145f601dccfe6f6cd3c)
Co-authored-by: Dora203 <66343334+sku2000@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(GH-105386) (GH-105697)
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
(cherry picked from commit 2b90796be6959d5ef46b38c434a514fce25be971)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
| |
(cherry picked from commit 20a56d8becba1a5a958b167fdb43b1a1b9228095)
Add proper error handling to add_errors_module() to prevent exceptions
from possibly being overwritten.
|
|
|
|
|
|
|
| |
Prevent repeated PyLong_FromVoidPtr() from possibly overwriting the
current exception.
(cherry picked from commit e8998e46a7ce8ad336e0941a6da6e50cb88d1e47)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Fix a bug where an IndexError could end up being overwritten.
(cherry picked from commit f668f73bc88cce0112b304d87aa998fb28013c71)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Fix a bug where an exception could end up being overwritten.
(cherry picked from commit c932f7284977ebf813313157c52d716ba225a7ac)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Improve error handling so init bails on the first exception.
(cherry picked from commit 16d49680b56e00c53c00683b949138e584669fd3)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
| |
Add proper error handling to prevent reference leaks and overwritten
exceptions.
(cherry picked from commit 01f4230460454d4a849a5ba93320142c1a0c93a8)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Fix a bug where 'tp_richcompare' could end up overwriting an exception.
(cherry picked from commit 35cff545db7c7912046c0ce5627db2e4d2b60f57)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(#105612)
Fix bugs where exceptions could end up being overwritten
because of deferred error handling.
(cherry picked from commit 33c92c4f15539806c8aff8574ff30a8b307e3e4d)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
|
| |
(GH-105608) (#105615)
Bail on first error in heapctypesubclasswithfinalizer_finalize()
(cherry picked from commit d636d7dfe714e7168b342c7ea5f9f9d3b3569ed0)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Fix bugs where exceptions could end up being overwritten.
(cherry picked from commit 00b599ab5a76023fa0083d7cc5d3c569342a5191)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
(cherry picked from commit eede1d2f48b4fe7f7918952d9ebeb744b58668c1)
Bail immediately if an exception is set, to prevent exceptions from
being overwritten.
|
|
|
|
|
|
| |
(cherry picked from commit 89aac6f6b7b3af046ec137121c90732289e79efc)
Error handling was deferred in some cases, which could potentially lead
to exceptions being overwritten.
|
|
|
|
|
|
|
|
| |
(gh-105465) (gh-105471)
Fixes a typo in d2e2e53.
(cherry picked from commit 5394bf92aa6516feb3322d8372d1579bd9c1417b)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
|
|
|
|
| |
(GH-105457) (#105458)
|
|
|
|
|
|
|
|
| |
(GH-105412) (#105440)
Check for error after each call to PyUnicode_FromStringAndSize().
(cherry picked from commit a24a780d937109a0982d807473ae410cc75b0e3b)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
gh-104399: Use newer libtommath APIs when necessary (GH-104407)
(cherry picked from commit 00d73caf804c0474980e471347d6385757af975f)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#105371)
* gh-102304: doc: Add links to Stable ABI and Limited C API (#105345)
* Add "limited-c-api" and "stable-api" references.
* Rename "stable-abi-list" reference to "limited-api-list".
* Makefile: Document files regenerated by "make regen-limited-abi"
* Remove first empty line in generated files:
- Lib/test/test_stable_abi_ctypes.py
- PC/python3dll.c
(cherry picked from commit bae415ad02c79cf3a2eec4aa6969221a12e6716f)
* gh-102304: Fix up Simple ABI doc (GH-105351)
(cherry picked from commit 0202aa002e06acef9aa55ace0d939103df19cadd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
finalization (GH-104826) (#105277)
gh-104690 Disallow thread creation and fork at interpreter finalization (GH-104826)
Disallow thread creation and fork at interpreter finalization.
in the following functions, check if interpreter is finalizing and raise `RuntimeError` with appropriate message:
* `_thread.start_new_thread` and thus `threading`
* `posix.fork`
* `posix.fork1`
* `posix.forkpty`
* `_posixsubprocess.fork_exec` when a `preexec_fn=` is supplied.
---------
(cherry picked from commit ce558e69d4087dd3653207de78345fbb8a2c7835)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
| |
_testcapimodule/get_basic_static_type() (GH-105225) (#105248)
(cherry picked from commit e01b04c9075c6468ed57bc883693ec2a06a6dd8e)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
|
|
|
| |
PyType_Ready() (gh-105122) (gh-105211)
When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary). That led to problems for third-party static types.
We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.
(cherry picked from commit 1469393)
Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
|
|
|
|
|
|
|
|
| |
Static Builtin Types (gh-105115) (gh-105124)
In gh-103912 we added tp_bases and tp_mro to each PyInterpreterState.types.builtins entry. However, doing so ignored the fact that both PyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses). We address that here by reverting back to shared objects, making them immortal in the process.
(cherry picked from commit 7be667d)
Co-authored-by: Eric Snow ericsnowcurrently@gmail.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#105199)
gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174)
Upgrade builds to OpenSSL 1.1.1u.
This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t.
The Mac/BuildScript/build-installer.py was already updated.
Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9, and adds a new _ssl_data_31.h file from 3.1.1 along with the ssl.c code to use it.
Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting).
backports of this prior to 3.12 will not include the openssl 3.1 header.
(cherry picked from commit ede89af605b1c0442353435ad22195c16274f65d)
Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Quoting autoconf (v2.71):
All current systems provide time.h; it need not be checked for.
Not all systems provide sys/time.h, but those that do, all allow
you to include it and time.h simultaneously.
(cherry picked from commit 9ab587b7146618866cee52c220aecf7bd5b44b02)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
|
| |
test_import (GH-105085) (#105170)
(cherry picked from commit a99b9d911e0f8cb11b3436bdd8eb649b15d01a50)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
| |
(cherry picked from commit cda1bd3c9d3b2cecdeeba0c498cd2df83fbdb535)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
|
|
|
|
| |
implementation in the unstable API (GH-105072) (#105095)
(cherry picked from commit b7aadb4583b040ddc8564896b91f4e5e571c82d6)
|
|
|
|
|
|
|
|
|
|
| |
(GH-105082) (#105083)
Correctly decref 'initialized' in init_module()
(cherry picked from commit d14eb3433cf2a40a202471b815f0a935f2840ead)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
| |
not support FileIdInformation (GH-104892)
(cherry picked from commit 6031727a37c6003f78e3b0c7414a0a214855dd08)
Co-authored-by: Steve Dower <steve.dower@python.org>
|