summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-101400: Fix incorrect lineno in exception message on contin… ↵Dong-hee Na2023-01-311-0/+16
| | | | (gh-101447)
* [3.11] Update copyright years to 2023. (gh-100848) (GH-100849)Miss Islington (bot)2023-01-091-1/+1
| | | | | (cherry picked from commit 11f99323c2ae0ec428c370a335695e3d8d4afc1d) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.11] gh-100776: Fix misleading default value in help(input) (GH-100788) ↵Shantanu2023-01-082-4/+4
| | | | | | | (#100841) (cherry picked from commit a2141882f259e21bb09fa0b7cba8142147b9e3d7) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-95778: add doc missing in some places (GH-100627)Miss Islington (bot)2022-12-301-0/+2
| | | | | (cherry picked from commit 46521826cb1883e29e4640f94089dd92c57efc5b) Co-authored-by: Éric <earaujo@caravan.coop>
* [3.11] gh-64490: Fix bugs in argument clinic varargs processing (GH-32092) ↵colorfulappl2022-12-281-1/+19
| | | | | (#100368) (cherry picked from commit 0da728387c99fe6c127b070f2d250dc5bdd62ee5)
* [3.11] Correct CVE-2020-10735 documentation (GH-100306). (#100476)Gregory P. Smith2022-12-242-4/+4
| | | | | (cherry picked from commit 1cf3d78c92eb07dc09d15cc2e773b0b1b9436825) Co-authored-by: Jeremy Paige <ucodery@gmail.com>
* [3.11] gh-99240: Reset pointer to NULL when the pointed memory is freed in ↵colorfulappl2022-12-211-5/+5
| | | | | | | | argument parsing (GH-99890) (#100385) (cherry picked from commit efbb1eb9f54cad4f7bf5df03eed3a6aba02d99f4) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] GH-99729: Unlink frames before clearing them (#100047)Brandt Bucher2022-12-062-10/+11
|
* [3.11] gh-99103: Normalize specialized traceback anchors against the current ↵Batuhan Taskaya2022-11-211-2/+7
| | | | | | | | | | line (#99423) [3.11] gh-99103: Normalize specialized traceback anchors against the current line (GH-99145) Automerge-Triggered-By: GH:isidentical. (cherry picked from commit 57be5459593bbd09583317ebdafc4d58ae51dbf4) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* gh-99578: Fix refleak in _imp.create_builtin() (GH-99642)Miss Islington (bot)2022-11-211-1/+2
| | | | | | | Fix a reference bug in _imp.create_builtin() after the creation of the first sub-interpreter for modules "builtins" and "sys". (cherry picked from commit cb2ef8b2acbb231c207207d3375b2f8b0077a6ee) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638)Miss Islington (bot)2022-11-211-3/+4
| | | | | | | | | | | | | | gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) Fix a number of compile errors with GCC-12 on macOS: 1. In pylifecycle.c the compile rejects _Pragma within a declaration 2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS 3. _ctypes assumed that __builtin_available is always present on macOS (cherry picked from commit cdde29dde90947df9bac39c1d19479914fb3db09) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* [3.11] GH-99460: Emscripten trampolines on optimized METH_O and METH_NOARGS ↵Hood Chatham2022-11-161-3/+3
| | | | | code paths (gh-99461) (#99514) Manual backport of GH-99461.
* gh-87604: Avoid publishing list of active per-interpreter audit hooks via ↵Miss Islington (bot)2022-11-151-0/+2
| | | | | | | the gc module (GH-99373) (cherry picked from commit 4e4b13e8f6211abbc0d53056da11357756daa314) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.11] GH-99298: Don't perform jumps before error handling (GH-99343)Brandt Bucher2022-11-111-3/+11
|
* [3.11] GH-99257: Check the owner's type when specializing slots (GH-99324)Miss Islington (bot)2022-11-101-0/+8
| | | | | (cherry picked from commit 9d692841691590c25e6cf5b2250a594d3bf54825) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* GH-99205: Mark new interpreters and threads as non-static (GH-99268)Miss Islington (bot)2022-11-091-0/+8
| | | | | (cherry picked from commit 283ab0e1c002f2d7459d581df6b4b8599e7d1a4d) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* gh-98978: Fix Py_SetPythonHome(NULL) (GH-99066)Miss Islington (bot)2022-11-031-0/+6
| | | | | | | | | Fix use-after-free in Py_SetPythonHome(NULL), Py_SetProgramName(NULL) and _Py_SetProgramFullPath(NULL) function calls. Issue reported by Benedikt Reinartz. (cherry picked from commit b07f546ea3a574bc3016fb023c157c65a47f4849) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.11] gh-98925: Lower marshal recursion depth for WASI (GH-98938) (GH-98979)Miss Islington (bot)2022-11-011-0/+2
| | | | | | | | | | * gh-98925: Lower marshal recursion depth for WASI (GH-98938) For wasmtime 2.0, the stack depth cost is 6% higher. This causes the default max `marshal` recursion depth to blow the stack. As the default marshal depth is 2000 and Windows is set to 1000, split the difference and choose 1500 for WASI to be safe. (cherry picked from commit 9711265182f163ba381e7800e3748ac28710f9ef) Co-authored-by: Brett Cannon <brett@python.org>
* [3.11] gh-96853: Restore test coverage for Py_Initialize(Ex) (GH-98874)Miss Islington (bot)2022-10-301-0/+1
| | | | | | | | | | | | | * As most of `test_embed` now uses `Py_InitializeFromConfig`, add a specific test case to cover `Py_Initialize` (and `Py_InitializeEx`) * Rename `_testembed` init helper to clarify the API used * Add a `PyConfig_Clear` call in `Py_InitializeEx` to make the code more obviously correct (it already didn't leak as none of the dynamically allocated config fields were being populated, but it's clearer if the wrappers follow the documented API usage guidelines) (cherry picked from commit 05e48865be69e1e5824f6915b588ff054717bb42) Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
* [3.11] GH-93354: Fix PRECALL's adaptive backoff (GH-98011)Brandt Bucher2022-10-121-2/+2
|
* Add a warning message about PyOS_snprintf (GH-95993)Miss Islington (bot)2022-10-071-0/+1
| | | | | (cherry picked from commit c7b220499662f0c7a4cae51e33372f92ca7b1ee9) Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* [3.11] GH-97002: Prevent _PyInterpreterFrames from backing more than one ↵Miss Islington (bot)2022-10-071-6/+23
| | | | | PyFrameObject (GH-98002) (cherry picked from commit 21a2d9ff550977f2668e2cf1cc15793bf27fa109)
* [3.11] gh-96017: Fix some compiler warnings (GH-96018) (#96106)Christian Heimes2022-10-051-0/+2
| | | | | | - only define recreate_gil with ifdef HAVE_FORK. (cherry picked from commit d9c1b746b5013f81d1724757bb3c6a1c87c4a8dc) Co-authored-by: Christian Heimes <christian@python.org>
* [3.11] GH-97779: Ensure that *all* frame objects are backed by "complete" ↵Miss Islington (bot)2022-10-051-0/+7
| | | | | | | frames (GH-97886) (cherry picked from commit 0ff8fd65838f9f9ed90d7a055d26a2ce9fc0ce85) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] GH-97752: Clear the previous member of newly-created ↵Miss Islington (bot)2022-10-041-0/+3
| | | | | generator/coroutine frames (GH-97812) (cherry picked from commit 93fcc1f4133e177882850177c2c047d46019b812)
* [3.11] Fix typos in `bltinmodule.c`. (GH-97789)Benjamin Peterson2022-10-032-12/+12
| | | | | (cherry picked from commit 873a2f25272ca9fb027866a9730c44ba627b30cc) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-96848: Fix -X int_max_str_digits option parsing (GH-96988)Miss Islington (bot)2022-09-261-1/+2
| | | | | | | | Fix command line parsing: reject "-X int_max_str_digits" option with no value (invalid) when the PYTHONINTMAXSTRDIGITS environment variable is set to a valid limit. (cherry picked from commit 41351662bcd21672d8ccfa62fe44d72027e6bcf8) Co-authored-by: Victor Stinner <vstinner@python.org>
* GH-96975: Skip incomplete frames in PyEval_GetFrame (GH-97018)Miss Islington (bot)2022-09-221-3/+6
| | | | | (cherry picked from commit 8fd2c3b75b90c4ee391894aa5094615bbdb6242f) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* Remove a stray DISPATCH() (GH-97004)Brandt Bucher2022-09-221-1/+0
|
* [3.11] GH-95921: Fix positions for some chained comparisons (GH-96968) ↵Brandt Bucher2022-09-201-0/+1
| | | | | | | (GH-96973) (cherry picked from commit dfc73b57247aac575c83055d960c03bdc28b51fd) Automerge-Triggered-By: GH:brandtbucher
* GH-96864: Check for error between line and opcode events (GH-96880)Miss Islington (bot)2022-09-201-1/+1
| | | | | (cherry picked from commit c10e33ac119d96c4d88d5ae8b59e65a76ae0ad3c) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* gh-96387: take_gil() resets drop request before exit (#96869) (#96941)Victor Stinner2022-09-201-0/+11
| | | | | | | | | | | | | | | At Python exit, sometimes a thread holding the GIL can wait forever for a thread (usually a daemon thread) which requested to drop the GIL, whereas the thread already exited. To fix the race condition, the thread which requested the GIL drop now resets its request before exiting. take_gil() now calls RESET_GIL_DROP_REQUEST() before PyThread_exit_thread() if it called SET_GIL_DROP_REQUEST to fix a race condition with drop_gil(). Issue discovered and analyzed by Mingliang ZHAO. (cherry picked from commit 04f4977f508583954ad7b9cb09076ee1e57461f8)
* GH-96754: Check whether the interpreter frame is complete before creating ↵Miss Islington (bot)2022-09-132-3/+8
| | | | | | | | | frame object. (GH-96776) (#96787) (cherry picked from commit 12c5f328d2479ac3432df5e266adc4e59adeabfe) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] gh-95853: Add script to automate WASM build (GH-95828, GH-95985, ↵Christian Heimes2022-09-131-3/+7
| | | | | | | | | | | | GH-96045, GH-96389, GH-96744) (GH-96749) Automate WASM build with a new Python script. The script provides several build profiles with configure flags for Emscripten flavors and WASI. The script can detect and use Emscripten SDK and WASI SDK from default locations or env vars. ``configure`` now detects Node arguments and creates HOSTRUNNER arguments for Node 16. It also sets correct arguments for ``wasm64-emscripten``.
* GH-96678: Fix undefined behavior in ceval.c (GH-96708)Miss Islington (bot)2022-09-101-1/+7
| | | | | (cherry picked from commit 50a70a083d34305a52fac4f5901bff2ead152d68) Co-authored-by: Mark Shannon <mark@hotpy.org>
* Fix possible NULL pointer dereference in _PyThread_CurrentFrames (GH-96584)Miss Islington (bot)2022-09-101-1/+6
| | | | | (cherry picked from commit 88a7f661ca02c0eb76b8f19234b8293b70f171e2) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] GH-96636: Remove all uses of NOTRACE_DISPATCH (GH-96643) (#96688)Mark Shannon2022-09-091-59/+57
| | | | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit aa3b4cf779b3dddb84e094879b91703354910d8c)
* [3.11] GH-96569: Avoid undefined behavior (#96616)Mark Shannon2022-09-081-8/+8
| | | Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* GH-96572: fix use after free in trace refs build mode (GH-96618)Miss Islington (bot)2022-09-061-1/+1
| | | | | (cherry picked from commit 67444902a0f10419a557d0a2d3b8675c31b075a9) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96500)Gregory P. Smith2022-09-023-3/+161
| | | | | | | | | | | | | | | | | | Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds. This PR comes fresh from a pile of work done in our private PSRT security response team repo. This backports https://github.com/python/cpython/pull/96499 aka 511ca9452033ef95bc7d7fc404b8161068226002 Signed-off-by: Christian Heimes [Red Hat] <christian@python.org> Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org> Reviews via the private PSRT repo via many others (see the NEWS entry in the PR). <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#).
* gh-96125: Fix sys.thread_info.name on pthread platforms (GH-96126) (#96128)Miss Islington (bot)2022-08-211-1/+1
| | | | | | | | Automerge-Triggered-By: GH:tiran (cherry picked from commit 822955c16654c22c10a993f5a94bbb68b857a150) Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Christian Heimes <christian@python.org>
* GH-96071: fix deadlock in PyGILState_Ensure (GH-96124) (#96129)Miss Islington (bot)2022-08-191-11/+16
| | | | | | | | Alternative of GH-96107 (cherry picked from commit e0d54a4a799dae4ebdd72a16bcf287ed62ae2972) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-95818: Skip incomplete frames in `PyThreadState_GetFrame` (GH-95886) (#95890)Miss Islington (bot)2022-08-121-2/+6
| | | | | | | (cherry picked from commit 1b46d118e6e72daa64b98cafddb406c68b419efa) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] gh-95174: Add pthread stubs for WASI (GH-95234) (#95503)Christian Heimes2022-08-013-6/+201
| | | | | | Co-authored-by: Brett Cannon <brett@python.org>. (cherry picked from commit 0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the ↵Miss Islington (bot)2022-07-311-48/+0
| | | | | | | command line (GH-28823)" (GH-94745) (cherry picked from commit aa37ffda29ac48fb2df5a7029ba2e626ecc45850) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.11] gh-95174: Handle missing dup() and constants in WASI (GH-95229) ↵Christian Heimes2022-07-312-1/+11
| | | | | (GH-95272) Co-authored-by: Christian Heimes <christian@python.org>
* GH-90081: Run python tracers at full speed (GH-95328) (#95363)Miss Islington (bot)2022-07-291-4/+7
| | | | | | | (cherry picked from commit b8b2990fb3218cffedfe7bc92e9e7ae2275b3c98) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] gh-94938: Fix errror detection of unexpected keyword arguments ↵Serhiy Storchaka2022-07-281-85/+57
| | | | | | | | | | | | | | | (GH-94999) (GH-95353) When keyword argument name is an instance of a str subclass with overloaded methods __eq__ and __hash__, the former code could not find the name of an extraneous keyword argument to report an error, and _PyArg_UnpackKeywords() returned success without setting the corresponding cell in the linearized arguments array. But since the number of expected initialized cells is determined as the total number of passed arguments, this lead to reading NULL as a keyword parameter value, that caused SystemError or crash or other undesired behavior. (cherry picked from commit ebad53a4dc1bb591820724a22cef9b8459185b5f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-95185: Check recursion depth in the AST constructor (GH-95186) ↵Miss Islington (bot)2022-07-261-1/+106
| | | | | | | | (GH-95208) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit 00474472944944b346d8409cfded84bb299f601a) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.11] GH-94739: Backport GH-94958 to 3.11 (#94965)Mark Shannon2022-07-251-14/+0
|