summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] GH-106152: Add PY_THROW event to cProfile (GH-106256)Miss Islington (bot)2023-06-291-0/+1
| | | | | | GH-106152: Add PY_THROW event to cProfile (GH-106161) (cherry picked from commit cea9d4ea82abcb2c6f1d83a2fe819859da4bbda4) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* [3.12] gh-105987: Fix reference counting issue in `_asyncio._swap_cur… ↵Kumar Aditya2023-06-261-4/+7
| | | | | | | | (#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>
* [3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… ↵Serhiy Storchaka2023-06-242-7/+8
| | | | | | | | | | (#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)
* [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752)Eric Snow2023-06-144-5/+128
| | | | 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)
* [3.12] gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620) ↵Miss Islington (bot)2023-06-131-7/+7
| | | | | | | | (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>
* [3.12] gh-105375: Improve error handling in _Unpickler_SetInputStream() ↵Erlend E. Aasland2023-06-131-13/+18
| | | | | | | | (#105667) (#105720) Prevent exceptions from possibly being overwritten in case of multiple failures. (cherry picked from commit 217589d4f3246d67c6ef0eb0be2b1c33987cf260)
* [3.12] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields ↵Miss Islington (bot)2023-06-121-37/+53
| | | | | | | | | | | | (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>
* [3.12] gh-105436: The environment block should end with two null wchar_t ↵Miss Islington (bot)2023-06-121-1/+13
| | | | | | | | 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>
* [3.12] gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL ↵Miss Islington (bot)2023-06-121-0/+13
| | | | | | | | (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>
* [3.12] gh-105375: Harden pyexpat initialisation (#105606) (#105669)Erlend E. Aasland2023-06-111-7/+11
| | | | | | (cherry picked from commit 20a56d8becba1a5a958b167fdb43b1a1b9228095) Add proper error handling to add_errors_module() to prevent exceptions from possibly being overwritten.
* [3.12] gh-105375: Improve error handling in _ctypes (GH-105593) (#105663)Miss Islington (bot)2023-06-111-4/+14
| | | | | | | 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>
* [3.12] gh-105375: Improve posix error handling (GH-105592) (#105598)Miss Islington (bot)2023-06-111-4/+8
| | | | | | 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>
* [3.12] gh-105375: Improve _decimal error handling (GH-105605) (#105647)Miss Islington (bot)2023-06-111-1/+5
| | | | | | 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>
* [3.12] gh-105375: Harden _datetime initialisation (GH-105604) (#105645)Miss Islington (bot)2023-06-111-5/+30
| | | | | | 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>
* [3.12] gh-105375: Harden _ssl initialisation (GH-105599) (#105642)Miss Islington (bot)2023-06-111-5/+11
| | | | | | | 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>
* [3.12] gh-105375: Improve array.array exception handling (GH-105594) (#105644)Miss Islington (bot)2023-06-111-3/+5
| | | | | | 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>
* [3.12] gh-105375: Improve error handling in `zoneinfo` module (GH-105586) ↵Miss Islington (bot)2023-06-091-6/+11
| | | | | | | | | | | (#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>
* [3.12] gh-105375: Harden error handling in `_testcapi/heaptype.c` ↵Miss Islington (bot)2023-06-091-1/+4
| | | | | | | | (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>
* [3.12] gh-105375: Improve error handling in _elementtree (GH-105591) (#105600)Miss Islington (bot)2023-06-091-3/+7
| | | | | | Fix bugs where exceptions could end up being overwritten. (cherry picked from commit 00b599ab5a76023fa0083d7cc5d3c569342a5191) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-105375: Improve errnomodule error handling (#105590) (#105596)Erlend E. Aasland2023-06-091-2/+5
| | | | | | (cherry picked from commit eede1d2f48b4fe7f7918952d9ebeb744b58668c1) Bail immediately if an exception is set, to prevent exceptions from being overwritten.
* [3.12] gh-105375: Improve _pickle error handling (#105475) (#105584)Erlend E. Aasland2023-06-091-12/+27
| | | | | | (cherry picked from commit 89aac6f6b7b3af046ec137121c90732289e79efc) Error handling was deferred in some cases, which could potentially lead to exceptions being overwritten.
* [3.12] gh-94673: Ensure subtypes are readied only once in math.trunc() ↵Miss Islington (bot)2023-06-071-1/+1
| | | | | | | | (gh-105465) (gh-105471) Fixes a typo in d2e2e53. (cherry picked from commit 5394bf92aa6516feb3322d8372d1579bd9c1417b) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
* [3.12] Fix grammar and improve clarity for an deprecation message. ↵Miss Islington (bot)2023-06-071-2/+2
| | | | (GH-105457) (#105458)
* [3.12] gh-105375: Improve error handling in sqlite3 collation callback ↵Miss Islington (bot)2023-06-071-3/+5
| | | | | | | | (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>
* [3.12] gh-104399: Use newer libtommath APIs when necessary (GH-104407) (#105343)Miss Islington (bot)2023-06-061-2/+21
| | | | | | gh-104399: Use newer libtommath APIs when necessary (GH-104407) (cherry picked from commit 00d73caf804c0474980e471347d6385757af975f) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) ↵Victor Stinner2023-06-061-1/+1
| | | | | | | | | | | | | | | | | | | (#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)
* [3.12] gh-104690 Disallow thread creation and fork at interpreter ↵Miss Islington (bot)2023-06-043-2/+30
| | | | | | | | | | | | | | | | | | | | | 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>
* [3.12] gh-104614: Fix potential ref. leak in ↵Miss Islington (bot)2023-06-021-1/+3
| | | | | | | _testcapimodule/get_basic_static_type() (GH-105225) (#105248) (cherry picked from commit e01b04c9075c6468ed57bc883693ec2a06a6dd8e) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-104614: Make Sure ob_type is Always Set Correctly by ↵Miss Islington (bot)2023-06-011-0/+45
| | | | | | | | | | 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
* [3.12] gh-105020: Share tp_bases and tp_mro Between Interpreters For All ↵Miss Islington (bot)2023-06-011-0/+23
| | | | | | | | 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
* [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) ↵Miss Islington (bot)2023-06-014-3/+8775
| | | | | | | | | | | | | | | | | | | | (#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>
* [3.12] gh-89886: Rely on HAVE_SYS_TIME_H (GH-105058) (#105192)Miss Islington (bot)2023-06-012-0/+6
| | | | | | | | | | | 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>
* [3.12] gh-102251: Explicitly free state for test modules with state in ↵Miss Islington (bot)2023-05-311-1/+21
| | | | | | | | 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>
* gh-88745: Add _winapi.CopyFile2 and update shutil.copy2 to use it (GH-105055)Miss Islington (bot)2023-05-302-1/+164
| | | | | (cherry picked from commit cda1bd3c9d3b2cecdeeba0c498cd2df83fbdb535) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* ↵Irit Katriel2023-05-302-1/+49
| | | | | implementation in the unstable API (GH-105072) (#105095) (cherry picked from commit b7aadb4583b040ddc8564896b91f4e5e571c82d6)
* [3.12] gh-102251: Fix reference leak in _testsinglephase initialization ↵Miss Islington (bot)2023-05-301-1/+3
| | | | | | | | | | (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>
* gh-104820: Fixes os.stat on Windows to better handle file systems that do ↵Miss Islington (bot)2023-05-291-4/+8
| | | | | | | not support FileIdInformation (GH-104892) (cherry picked from commit 6031727a37c6003f78e3b0c7414a0a214855dd08) Co-authored-by: Steve Dower <steve.dower@python.org>
* gh-104803: Implement ntpath.isdevdrive for checking whether a path is on a ↵Miss Islington (bot)2023-05-292-1/+159
| | | | | | | Windows Dev Drive (GH-104805) (cherry picked from commit bfd20d257e4ad16a25f4bac0ea4dbb719cdf6bc7) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] GH-101588: Deprecate pickle/copy/deepcopy support in itertools ↵Miss Islington (bot)2023-05-261-1/+43
| | | | (GH-104965) (GH-104997)
* [3.12] gh-104372: Drop the GIL around the vfork() call. (GH-104782) (#104942)Miss Islington (bot)2023-05-251-1/+18
| | | | | | | | | | | | | | gh-104372: Drop the GIL around the vfork() call. (GH-104782) On Linux where the `subprocess` module can use the `vfork` syscall for faster spawning, prevent the parent process from blocking other threads by dropping the GIL while it waits for the vfork'ed child process `exec` outcome. This prevents spawning a binary from a slow filesystem from blocking the rest of the application. Fixes GH-104372. (cherry picked from commit d08679212d9af52dd074cd4a6abb440edb944c9c) Co-authored-by: Gregory P. Smith <gps@python.org>
* [3.12] gh-99108: Refresh HACL* (GH-104808) (#104893)Miss Islington (bot)2023-05-2414-140/+214
| | | | | | | | gh-99108: Refresh HACL* (GH-104808) Refresh HACL* from upstream to improve SHA2 performance and fix a 32-bit issue in SHA3. (cherry picked from commit 160321e5304b962a162eb023472aa2bc8307ae15) Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
* [3.12] gh-104372: use == -1 before PyErr_Occurred (GH-104831) (#104833)Miss Islington (bot)2023-05-241-1/+1
| | | | | | | | gh-104372: use == -1 before PyErr_Occurred (GH-104831) The ideal pattern for this. (already in the 3.11 backport) (cherry picked from commit 7f963bfc79a515dc9822ebddbfb1b5927d2dda09) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.12] gh-103295: fix stack overwrite on 32-bit in perf map test harness ↵Miss Islington (bot)2023-05-231-4/+9
| | | | | | | | (GH-104811) (#104823) gh-103295: fix stack overwrite on 32-bit in perf map test harness (GH-104811) (cherry picked from commit e0b3078705b271ff278dfbc788c2b061c92a9aa3) Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.12] gh-99108: Release the GIL around hashlib built-in computation ↵Miss Islington (bot)2023-05-236-15/+204
| | | | | | | | | | | | | | (GH-104675) (#104776) gh-99108: Release the GIL around hashlib built-in computation (GH-104675) This matches the GIL releasing behavior of our existing `_hashopenssl` module, extending it to the HACL* built-ins. Includes adding comments to better describe the ENTER/LEAVE macros purpose and explain the lock strategy in both existing and new code. (cherry picked from commit 2e5d8a90aa633ff0bebc9b2b8e21eea389937b19) Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
* GH-103092: isolate `_ssl` (#104725)Kumar Aditya2023-05-223-14/+21
|
* gh-98836: Extend PyUnicode_FromFormat() (GH-98838)Serhiy Storchaka2023-05-214-29/+52
| | | | | | | | | * Support for conversion specifiers o (octal) and X (uppercase hexadecimal). * Support for length modifiers j (intmax_t) and t (ptrdiff_t). * Length modifiers are now applied to all integer conversions. * Support for wchar_t C strings (%ls and %lV). * Support for variable width and precision (*). * Support for flag - (left alignment).
* gh-103857: Document utcnow and utcfromtimestamp deprecations in What's New ↵Hugo van Kemenade2023-05-211-1/+1
| | | | | | (#104542) Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* GH-101291: Add low level, unstable API for pylong (GH-101685)Mark Shannon2023-05-211-0/+13
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-103295: expose API for writing perf map files (#103546)gsallam2023-05-211-0/+27
| | | | | Co-authored-by: Aniket Panse <aniketpanse@fb.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-104469: Convert _testcapi/exceptions to use AC (gh-104502)Dong-hee Na2023-05-212-97/+531
|