summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [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
|
* [3.11] GH-94036: Fix more attribute location quirks (GH-95028) (GH-95156)Brandt Bucher2022-07-231-20/+23
| | | (cherry picked from commit 900bfc53cb133e8bc2b122362ec04256f623d5b0)
* [3.11] GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121) ↵Brandt Bucher2022-07-223-3/+14
| | | | | (GH-95143) (cherry picked from commit e402b26b7fb953a2f0c17a0044bb6d6cbd726e54)
* [3.11] GH-91409: Don't overwrite valid locations with NOP locations ↵Brandt Bucher2022-07-201-1/+4
| | | | | (GH-95067) (GH-95068) (cherry picked from commit 742d4614e1a645d765dbf76c19bd9a818239b1cb)
* GH-94851: fix immortal objects refcounting in compiler (gh-95040)Miss Islington (bot)2022-07-201-1/+1
| | | | | (cherry picked from commit 74761548862eb5a324c23d86a6233d884f386f2e) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-91256: Ensure help text has the program name even before getpath is ↵Miss Islington (bot)2022-07-191-0/+3
| | | | | | | called (GH-94929) (cherry picked from commit 49aeff49d71fa4bd935212340410311f13879447) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.11] GH-94822: Don't specialize when metaclasses are involved (GH-94892) ↵Brandt Bucher2022-07-181-6/+5
| | | | | | | (GH-94980) (cherry picked from commit daf68ba92f315bfd239a0c993f9f683fb90325fb) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)Miss Islington (bot)2022-07-181-3/+1
| | | | | (cherry picked from commit 067f0da33506f70c36a67d5f3d8d011c8dae10c9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-91348: Restore frame argument to sys._getframe audit event (GH-94928)Miss Islington (bot)2022-07-171-5/+7
| | | | | (cherry picked from commit 044a593cbbe1639e906e06c47504dd1020ddfee4) Co-authored-by: Steve Dower <steve.dower@python.org>
* gh-94864: Fix PyArg_Parse* with deprecated format units "u" and "Z" (GH-94902)Serhiy Storchaka2022-07-171-1/+1
| | | It returned 1 (success) when warnings are turned into exceptions.
* [3.11] gh-93883: elide traceback indicators when possible (GH-93994) (GH-94740)John Belmonte2022-07-111-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Elide traceback column indicators when the entire line of the frame is implicated. This reduces traceback length and draws more attention to the remaining (very relevant) indicators. Example: ``` Traceback (most recent call last): File "query.py", line 99, in <module> bar() File "query.py", line 66, in bar foo() File "query.py", line 37, in foo magic_arithmetic('foo') File "query.py", line 18, in magic_arithmetic return add_counts(x) / 25 ^^^^^^^^^^^^^ File "query.py", line 24, in add_counts return 25 + query_user(user1) + query_user(user2) ^^^^^^^^^^^^^^^^^ File "query.py", line 32, in query_user return 1 + query_count(db, response['a']['b']['c']['user'], retry=True) ~~~~~~~~~~~~~~~~~~^^^^^ TypeError: 'NoneType' object is not subscriptable ``` Automerge-Triggered-By: GH:pablogsal
* [3.11] GH-94694: Fix column offsets for multi-line method lookups (GH-94721)Brandt Bucher2022-07-101-2/+9
| | | (cherry picked from commit 264b3ddfd561d97204ffb30be6a7d1fb0555e560)
* [3.11] GH-93252: Fix error handling for failed Python calls (GH-94693) ↵Kumar Aditya2022-07-091-1/+5
| | | | | (GH-94708) Automerge-Triggered-By: GH:tiran
* [3.11] gh-94215: Fix error handling for line-tracing events (GH-94681) ↵Christian Heimes2022-07-081-5/+14
| | | | | | | | | | (GH-94688) * Re-enable crasher * Fix error handling for line-tracing events * blurb add (cherry picked from commit 23ee4a8067506e6c9c47748185653617413f7a60) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] gh-92228: disable the compiler's 'small exit block inlining' ↵Christian Heimes2022-07-071-0/+14
| | | | | | | | | | optimization for blocks that have a line number (GH-94592) (GH-94643) Inlining of code that corresponds to source code lines, can make it hard to distinguish later between code which is only reachable from except handlers, and that which is reachable in normal control flow. This caused problems with the debugger's jump feature. This PR turns off the inlining optimisation for code which has line numbers. We still inline things like the implicit "return None".. (cherry picked from commit bde06e1b8381f140b296a397ddd1deb1c784ff8e) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.11] gh-94510: Raise on re-entrant calls to sys.setprofile and ↵Łukasz Langa2022-07-051-2/+24
| | | | | | | | sys.settrace (GH-94511) (GH-94578) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 40d81fd63b46cf998880ce3bf3e5cb42bc3199c1)
* [3.11] gh-94485: Set line number of module's RESUME instruction to 0 as ↵Łukasz Langa2022-07-051-1/+4
| | | | | | | | | specified by PEP 626 (GH-94552) (GH-94562) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Mark Shannon <mark@hotpy.org> (cherry picked from commit 324d01944d16868b07df9e8eef6987766a31a36d)
* [3.11] GH-94262: Don't create frame objects for frames that aren't yet ↵Miss Islington (bot)2022-07-042-5/+17
| | | | | complete. (GH-94371) (#94482) Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] GH-93354: Use exponential backoff to avoid excessive specialization ↵Mark Shannon2022-06-302-45/+48
| | | | | | attempts (GH-93355) (GH-93379) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-91719: Reload opcode on unknown error so that C can optimize the ↵Miss Islington (bot)2022-06-301-0/+3
| | | | | | | dispatching in ceval.c (GH-94364) (#94453) (cherry picked from commit ea39b77de9fa25b447d0b4148f75f351076e890a) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>