summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-107913: Fix possible losses of OSError error codes (GH-107930) ↵Serhiy Storchaka2023-08-271-1/+3
| | | | | | | | (GH-108524) Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be called immediately after using the C API which sets errno or the Windows error code. (cherry picked from commit 2b15536fa94d07e9e286826c23507402313ec7f4)
* [3.11] gh-107916: Save the error code before decoding the filename in ↵Miss Islington (bot)2023-08-211-0/+8
| | | | | | | PyErr_SetFromErrnoWithFilename() etc (GH-107929) (GH-108206) (cherry picked from commit 80bdebdd8593f007a2232ec04a7729bba6ebf12c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-107915: Handle errors in C API functions PyErr_Set*() and ↵Serhiy Storchaka2023-08-191-8/+29
| | | | | | | | | PyErr_Format() (GH-107918) (GH-108135) Such C API functions as PyErr_SetString(), PyErr_Format(), PyErr_SetFromErrnoWithFilename() and many others no longer crash or ignore errors if it failed to format the error message or decode the filename. Instead, they keep a corresponding error. (cherry picked from commit 633ea217a85f6b6ba5bdbc73094254d5811b3485)
* [3.11] gh-106242: Fix path truncation in os.path.normpath (GH-106816) (#107982)Steve Dower2023-08-151-8/+21
| | | Co-authored-by: Finn Womack <flan313@gmail.com>
* [3.11] gh-86493: Fix possible leaks in some modules initialization ↵Serhiy Storchaka2023-07-191-19/+10
| | | | | | | | | (GH-106768) (GH-106855) (GH-106863) [3.11] [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time. (cherry picked from commit 3e65baee72131b49f4ce8ca2da568a6f2001ce93). (cherry picked from commit a423ddbdeada8a2fd8657453b9e9f58ba0dd921d)
* [3.11] Document PYTHONSAFEPATH along side -P (GH-106122) (#106353)Miss Islington (bot)2023-07-051-2/+2
| | | | | (cherry picked from commit 0355625d94a50f4b816770bad946420d005900b8) Co-authored-by: Jeremy Paige <ucodery@gmail.com>
* [3.11] gh-101006: Improve error handling when read marshal data (GH-101007) ↵Miss Islington (bot)2023-06-291-61/+71
| | | | | | | | | | | | (GH-106227) * EOFError no longer overrides other errors such as MemoryError or OSError at the start of the object. * Raise more relevant error when the NULL object occurs as a code object component. * Minimize an overhead of calling PyErr_Occurred(). (cherry picked from commit 8bf6904b229583033035d91a3800da5604dcaad4) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-105979: Fix exception handling in unmarshal_frozen_code ↵Kumar Aditya2023-06-261-0/+1
| | | | | | | | (`Python/import.c`) (GH-105980). (#106100) * [3.11] gh-105979: Fix exception handling in `unmarshal_frozen_code` (`Python/import.c`) (GH-105980). (cherry picked from commit cd5280367a3a7065d13b8f7234474f7a2e9a18fd) Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
* [3.11] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… ↵Serhiy Storchaka2023-06-241-7/+5
| | | | | | | | | | (#106040) [3.11] 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.11] gh-106030: Miscellaneous fixes in Python/suggestions.c (GH-106… ↵Serhiy Storchaka2023-06-231-6/+6
| | | | | | | | | | (GH-106039) * PyUnicode_CompareWithASCIIString() only works if the second argument is ASCII string. * Refleak in get_suggestions_for_name_error. * Add some missing error checks. (cherry picked from commit c8c162ef5294cddb7ac75fe93ab918e5661c68ee)
* [3.11] GH-105840: Fix assertion failures when specializing calls with too ↵Miss Islington (bot)2023-06-161-2/+2
| | | | | | | | many __defaults__ (GH-105864) GH-105840: Fix assertion failures when specializing calls with too many __defaults__ (GH-105847) (cherry picked from commit 2beab5bdef5fa2a00a59371e6137f769586b7404) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] GH-105588: Add missing error checks to some obj2ast_* converters ↵Miss Islington (bot)2023-06-151-0/+7
| | | | | | | | (GH-105839) GH-105588: Add missing error checks to some obj2ast_* converters (GH-105589) (cherry picked from commit a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] gh-105673: Fix uninitialized warning in sysmodule.c (GH-105674) (#105676)Miss Islington (bot)2023-06-121-1/+1
| | | | | | In sys_add_xoption(), 'value' may be uninitialized for some error paths. (cherry picked from commit a8d69fe92c65d636fc454cfb1825c357eb2e6325) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] gh-105375: Improve error handling in the sys extension module ↵Erlend E. Aasland2023-06-111-6/+18
| | | | | | | | | (#105611) (#105666) (cherry picked from commit 41cddc2e93a285b81fa30ac542b088bd9d0112e9) In _PySys_AddXOptionWithError() and sys_add_xoption(), bail on first error to prevent exceptions from possibly being overwritten.
* [3.11] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) ↵Miss Islington (bot)2023-06-111-12/+16
| | | | | | | | | (#105660) Bail on first error to prevent exceptions from possibly being overwritten. (cherry picked from commit 567d6ae8e77579173510fc948ac06b2ababf3d40) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve error handling in the builtins extension module ↵Miss Islington (bot)2023-06-111-8/+32
| | | | | | | (GH-105585) (#105650) (cherry picked from commit d4fa52934a282df51cff800eee5caeb94a229547) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105375: Improve error handling in compiler_enter_scope() (#105494) ↵Erlend E. Aasland2023-06-091-1/+5
| | | | | | | (#105582) (cherry picked from commit 6c832ddcf28187f86100c790afb16a0223d945d0) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] gh-105164: Detect annotations inside match blocks (GH-105177). (#105314)Jelle Zijlstra2023-06-051-0/+9
| | | (cherry picked from commit 69d1245685cf95ddc678633e978a56673da64865)
* [3.11] gh-105184: document that marshal functions can fail and need to be ↵Miss Islington (bot)2023-06-021-0/+4
| | | | | | | | checked with PyErr_Occurred (GH-105185) (#105219) gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185) (cherry picked from commit ee26ca13a129da8cf549409d0a1b2e892ff2b4ec) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.11] GH-102818: Do not call PyTraceBack_Here in sys.settrace trampoline ↵Mark Shannon2023-05-191-4/+0
| | | | | (GH-104650) Backport of GH-104579
* [3.11] gh-104615: don't make unsafe swaps in apply_static_swaps (GH-104620). ↵Carl Meyer2023-05-191-0/+20
| | | | | (#104636) (cherry picked from commit 0589c6a4d3d822cace42050198cb9a5e99c879ad)
* [3.11] gh-104482: Fix error handling bugs in ast.c (#104514)Irit Katriel2023-05-161-19/+37
|
* [3.11] GH-104405: Add missing PEP 523 checks (GH-104441)Brandt Bucher2023-05-122-0/+5
|
* [3.11] gh-96670: Raise SyntaxError when parsing NULL bytes (GH-97594) (#104195)Lysandros Nikolaou2023-05-071-1/+1
|
* [3.11] gh-104018: remove unused format "z" handling in string formatfloat() ↵Miss Islington (bot)2023-05-071-1/+0
| | | | | | | | | | (GH-104107) (#104260) gh-104018: remove unused format "z" handling in string formatfloat() (GH-104107) This is a cleanup overlooked in PR GH-104033. (cherry picked from commit 69621d1b09c996e43a1e13d2fa4c317d3dd4d738) Co-authored-by: John Belmonte <john@neggie.net>
* [3.11] gh-103886: Improve `builtins.__doc__` (GH-104179) (#104257)Miss Islington (bot)2023-05-071-2/+9
| | | | | | | gh-103886: Improve `builtins.__doc__` (GH-104179) (cherry picked from commit b35711d17a90251bdd57d255090e07daafe89f6c) Co-authored-by: Tomas R <tomas.roun8@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.11] GH-103971: Fix incorrect locations for code following case blocksTian Gao2023-04-281-0/+2
|
* [3.11] gh-101517: fix line number propagation in code generated for except* ↵Irit Katriel2023-04-251-14/+24
| | | | | | | | | | | | | | | (#103550) (#103816) Manual backport of https://github.com/python/cpython/pull/103550. <!-- gh-issue-number: gh-101517 --> * Issue: gh-101517 <!-- /gh-issue-number --> --------- Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.11] gh-102281: Fix potential nullptr dereference + use of uninitia… ↵Max Bachmann2023-03-251-1/+5
| | | | | | (#103040) [3.11] gh-102281: Fix potential nullptr dereference + use of uninitialized memory (gh-102282) (cherry picked from commit afa6092ee4260bacf7bc11905466e4c3f8556cbb)
* gh-98608: Fix Failure-handling in new_interpreter() (gh-102658)Miss Islington (bot)2023-03-211-1/+1
| | | | | | | | The error-handling code in new_interpreter() has been broken for a while. We hadn't noticed because those code mostly doesn't fail. (I noticed while working on gh-101660.) The problem is that we try to clear/delete the newly-created thread/interpreter using itself, which just failed. The solution is to switch back to the calling thread state first. (cherry picked from commit d1b883b52a99427d234c20e4a92ddfa6a1da8880) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> https: //github.com/python/cpython/issues/98608
* [3.11] gh-101975: Fixed a potential SegFault on garbage collection ↵Mark Shannon2023-03-201-0/+1
| | | | | (GH-102803) (GH-102807) Authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
* gh-102356: Add thrashcan macros to filter object dealloc (GH-102426)Miss Islington (bot)2023-03-051-0/+2
| | | | | | Add thrashcan macros to the deallocator of the filter objects to protect against deeply nested destruction of chains of nested filters. (cherry picked from commit 66aa78cbe604a7c5731f074b869f92174a8e3b64) Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
* [3.11] GH-102126: fix deadlock at shutdown when clearing thread state… ↵Kumar Aditya2023-02-251-2/+10
| | | | | | | (#102234) [3.11] GH-102126: fix deadlock at shutdown when clearing thread states (GH-102222) (cherry picked from commit 5f11478ce7fda826d399530af4c5ca96c592f144)
* [3.11] gh-97786: Fix compiler warnings in pytime.c (GH-101826) (#102062)Miss Islington (bot)2023-02-221-6/+29
| | | | | | | | | gh-97786: Fix compiler warnings in pytime.c (GH-101826) Fixes compiler warnings in pytime.c. (cherry picked from commit b1b375e2670a58fc37cb4c2629ed73b045159918) Co-authored-by: Mark Dickinson <dickinsm@gmail.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* [3.11] gh-101967: add a missing error check (GH-101968) (#102015)Miss Islington (bot)2023-02-211-1/+3
| | | | | | | gh-101967: add a missing error check (GH-101968) (cherry picked from commit 89413bbccb9261b72190e275eefe4b0d49671477) Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-101614: Don't treat python3_d.dll as a Python DLL when checking extension ↵Miss Islington (bot)2023-02-081-4/+5
| | | | | | | modules for incompatibility (GH-101615) (cherry picked from commit 3a88de7a0af00872d9d57e1d98bc2f035cb15a1c) Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
* [3.11] gh-101072: support default and kw default in PyEval_EvalCodeEx for ↵Łukasz Langa2023-02-071-4/+0
| | | | | | 3.11+ (GH-101127) (#101636) Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Matthieu Dartiailh <m.dartiailh@gmail.com>
* [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>