summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-113560: Improve docstrings for set.issubset() and set.issuperset() ↵Miss Islington (bot)2024-01-271-2/+10
| | | | | | | (GH-113562) (GH-114643) (cherry picked from commit 11c582235d86b6020710eff282eeb381a7bf7bb7) Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
* [3.11] Document the `co_lines` method on code objects (#113682) (#113687)Alex Waygood2024-01-031-1/+1
| | | | | (cherry-picked from commit f1f839243251fef7422c31d6a7c3c747e0b5e27c) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* [3.11] gh-110383: Improve accuracy of str.split() and str.rsplit() ↵Hugo van Kemenade2023-12-222-5/+9
| | | | | | docstrings (GH-113355) (#113380) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.11] gh-112625: Protect bytearray from being freed by misbehaving iterator ↵Miss Islington (bot)2023-12-041-1/+4
| | | | | | | inside bytearray.join (GH-112626) (GH-112694) (cherry picked from commit 0e732d0997cff08855d98c17af4dd5527f10e419) Co-authored-by: chilaxan <chilaxan@gmail.com>
* [3.11] gh-112266: Remove `(if defined)` part from `__dict__` and ↵Nikita Sobolev2023-11-201-4/+4
| | | | `__weakref__` docstrings (GH-112268) (#112276)
* [3.11] GH-94438: Restore ability to jump over None tests (GH-111338)Savannah Ostrowski2023-10-251-2/+10
| | | (cherry picked from commit 6640f1d)
* [3.11] gh-108915: Removes extra backslashes in str.split docstring ↵Shantanu2023-09-072-5/+5
| | | | | | | | (GH-109044) (#109062) [3.11] gh-108915: Removes extra backslashes in str.split docstring (GH-109044). (cherry picked from commit e7d5433f944a5725aa82595f9251abfc8a63d333) Co-authored-by: Daniel Weiss <134341009+justdan6@users.noreply.github.com>
* [3.11] gh-107913: Fix possible losses of OSError error codes (GH-107930) ↵Serhiy Storchaka2023-08-271-1/+1
| | | | | | | | (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-86457: Fix signature for code.replace() (GH-23199) (GH-107746)Serhiy Storchaka2023-08-092-49/+43
| | | | Also add support of @text_signature in Argument Clinic. (cherry picked from commit 0e6e32fb84b2f7cb668e0b9927637587081e38cd)
* [3.11] gh-106092: Fix use-after-free crash in frame_dealloc (GH-106875) ↵Miss Islington (bot)2023-08-011-6/+7
| | | | (#107533)
* [3.11] gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data ↵Serhiy Storchaka2023-07-251-0/+3
| | | | | | | (GH-99613) (GH-107224) Previously *consumed was not set in this case. (cherry picked from commit f08e52ccb027f6f703302b8c1a82db9fd3934270)
* [3.11] gh-106719: Fix __annotations__ getter and setter in the type and ↵Serhiy Storchaka2023-07-182-48/+33
| | | | | | module types (GH-106720) (GH-106850) No longer suppress arbitrary errors. Simplify the code. (cherry picked from commit e1c295e3da9ff5a3eb6b009a1f821d80e564ac87)
* [3.11] gh-105235: Prevent reading outside buffer during mmap.find() (… ↵Dennis Sweeney2023-07-151-2/+19
| | | | | | | | | | | | (#106710) [3.11] 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)
* [3.11] Fix possible refleak in CodeType.replace() (GH-106243) (GH-106245)Miss Islington (bot)2023-06-291-0/+1
| | | | | | | | Fix possible refleak in CodeType.replace() (GH-106243) A reference to c_code was leaked if PySys_Audit() failed. (cherry picked from commit 3c70d467c148875f2ce17bacab8909ecc3e9fc1d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… ↵Serhiy Storchaka2023-06-241-16/+15
| | | | | | | | | | (#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-105375: Improve error handling in PyUnicode_BuildEncodingMap() ↵Miss Islington (bot)2023-06-111-12/+17
| | | | | | | | (GH-105491) (#105662) Bail on first error to prevent exceptions from possibly being overwritten. (cherry picked from commit 555be81026fe1205d16c02f6321221381174cd07) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.11] Fix refleak in super_descr_get (GH-104440)Brandt Bucher2023-05-121-1/+3
| | | (cherry picked from commit a781484c8e9834538e5ee7b9e2e6bec7b679e033)
* [3.11] GH-94841: Fix usage of Py_ALWAYS_INLINE (GH-104439)Brandt Bucher2023-05-121-1/+1
|
* [3.11] gh-96670: Raise SyntaxError when parsing NULL bytes (GH-97594) (#104195)Lysandros Nikolaou2023-05-071-10/+19
|
* [3.11] gh-104018: remove unused format "z" handling in string formatfloat() ↵Miss Islington (bot)2023-05-072-5/+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-103590: do not wrap a single exception raised from a try-except* ↵Irit Katriel2023-05-021-1/+6
| | | | (#104094)
* [3.11] gh-104018: disallow "z" format specifier in %-format of byte strings ↵Miss Islington (bot)2023-05-011-1/+0
| | | | | | | | | | | | | | | | | | (GH-104033) (#104058) gh-104018: disallow "z" format specifier in %-format of byte strings (GH-104033) PEP-0682 specified that %-formatting would not support the "z" specifier, but it was unintentionally allowed for bytes. This PR makes use of the "z" flag an error for %-formatting in a bytestring. Issue: GH-104018 --------- (cherry picked from commit 3ed8c882902a6982fd67e898a5b8a2d619fb5ddf) Co-authored-by: John Belmonte <john@neggie.net> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* [3.11] gh-99184: Bypass instance attribute access in `repr` of `weakref.ref` ↵Miss Islington (bot)2023-04-241-4/+1
| | | | | | | | (GH-99244) (#103789) gh-99184: Bypass instance attribute access in `repr` of `weakref.ref` (GH-99244) (cherry picked from commit 58b6be3791f55ceb550822ffd8664eca10fd89c4) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-87864: Use correct function definition syntax in the docs (GH-103312)Miss Islington (bot)2023-04-111-4/+4
| | | | | (cherry picked from commit 50b4b1598411ed393f47ce7f4fffbe5b9063cd42) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-102701: Fix overflow in dictobject.c (GH-102750)Miss Islington (bot)2023-03-171-1/+1
| | | | | (cherry picked from commit 65fb7c4055f280caaa970939d16dd947e6df8a8d) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* gh-101892: Fix `SystemError` when a callable iterator call exhausts the ↵Miss Islington (bot)2023-03-041-2/+2
| | | | | | | | iterator (GH-101896) (cherry picked from commit 705487c6557c3d8866622b4d32528bf7fc2e4204) Co-authored-by: Raj <51259329+workingpayload@users.noreply.github.com> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* gh-101765: unicodeobject: use Py_XDECREF correctly (GH-102283)Miss Islington (bot)2023-02-261-1/+1
| | | | | (cherry picked from commit 8d0f09b1beafd95763a5da53acc58dac0bd63a53) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.11] gh-101765: Fix refcount issues in list and unicode pickling ↵Jelle Zijlstra2023-02-262-1/+11
| | | | | (GH-102265) (#102268) (cherry picked from commit d71edbd1b7437706519a9786211597d95934331a)
* [3.11] gh-101765: Fix SystemError / segmentation fault in iter `__reduce__` ↵Ionite2023-02-257-23/+66
| | | | | when internal access of `builtins.__dict__` exhausts the iterator (GH-101769) (#102228) (cherry picked from commit 54dfa14c5a94b893b67a4d9e9e403ff538ce9023)
* [3.11] GH-101696: invalidate type version tag in `_PyStaticType_Dealloc` ↵Erlend E. Aasland2023-02-111-0/+2
| | | | | | | | (GH-101697) (#101722) [3.11] GH-101696: invalidate type version tag in `_PyStaticType_Dealloc` (GH-101697). (cherry picked from commit d9de0792482d2ded364b0c7d2867b97a5da41b12) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-101072: support default and kw default in PyEval_EvalCodeEx for ↵Łukasz Langa2023-02-071-2/+4
| | | | | | 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-101266: Revert fix __sizeof__ for subclasses of int (#101638)Mark Dickinson2023-02-072-8/+9
| | | | | Revert "[3.11] gh-101266: Fix __sizeof__ for subclasses of int (GH-101394) (#101579)" This reverts commit cf89c16486a4cc297413e17d32082ec4f389d725.
* [3.11] gh-101266: Fix __sizeof__ for subclasses of int (GH-101394) (#101579)Mark Dickinson2023-02-052-9/+8
| | | | | | | | Fix the behaviour of the `__sizeof__` method (and hence the results returned by `sys.getsizeof`) for subclasses of `int`. Previously, `int` subclasses gave identical results to the `int` base class, ignoring the presence of the instance dictionary. (Manual backport of #101394 to the Python 3.11 branch.)
* [3.11] gh-101037: Fix potential memory underallocation for zeros of int ↵Miss Islington (bot)2023-01-211-0/+5
| | | | | | | | | | | | | | subtypes (GH-101038) (#101219) gh-101037: Fix potential memory underallocation for zeros of int subtypes (GH-101038) This PR fixes object allocation in long_subtype_new to ensure that there's at least one digit in all cases, and makes sure that the value of that digit is copied over from the source long. Needs backport to 3.11, but not any further: the change to require at least one digit was only introduced for Python 3.11. Fixes GH-101037. (cherry picked from commit 401fdf9c851eb61229250ebffa942adca99b36d1) Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* gh-101056: Fix memory leak in `formatfloat()` in `bytesobject.c` (GH-101057)Miss Islington (bot)2023-01-161-1/+3
| | | | | (cherry picked from commit b1a74a182d8762bda51838401ac92b6ebad9632a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.11] GH-100942: Fix incorrect cast in property_copy(). (GH-100965). (#101008)Nikita Sobolev2023-01-151-3/+4
| | | | | (cherry picked from commit 94fc7706b7bc3d57cdd6d15bf8e8c4499ae53a69) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* [3.11] gh-100637: Fix int and bool __sizeof__ calculation to include the 1 ↵Miss Islington (bot)2023-01-031-1/+4
| | | | | | | | | | | | element ob_digit array for 0 and False (GH-100663) (#100717) gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit array for 0 and False (GH-100663) Fixes behaviour where int (and subtypes like bool) __sizeof__ under-reports true size as it did not take into account the size 1 `ob_digit` array for the zero int. (cherry picked from commit d7e7f79ca7c2029e46a06d21a7a5abea631b5d13) Co-authored-by: Ionite <dev@ionite.io> Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* [3.11] gh-99110: Initialize frame->previous in init_frame to fix ↵Bill Fisher2022-12-241-0/+1
| | | | | | | segmentation fault (GH-100182) (#100478) (cherry picked from commit 88d565f32a709140664444c6dea20ecd35a10e94) Co-authored-by: Bill Fisher <william.w.fisher@gmail.com>
* clarify the 4300-digit limit on int-str conversion (GH-100175)Miss Islington (bot)2022-12-121-2/+2
| | | | | (cherry picked from commit 935ef593211a627526b2b869ce1fc2a5e67e6cdd) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* [3.11] gh-99886: Fix crash when freeing objects with managed dictionaries ↵Ken Jin2022-12-041-3/+5
| | | | | (#99902) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-99845: _PyObject_DictPointer(): fix dictoffset cast (#99922)Victor Stinner2022-12-011-1/+2
| | | | Cast size_t to Py_ssize_t, rather than casting it to long. On 64-bit Windows, long is 32-bit whereas Py_ssize_t is 64-bit.
* gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException ↵Miss Islington (bot)2022-11-181-1/+13
| | | | | | | (GH-99572) (cherry picked from commit c8c6113398ee9a7867fe9b08bc539cceb61e2aaa) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-99443: `descr_set_trampoline_call` return type should be `int` not ↵Miss Islington (bot)2022-11-161-1/+1
| | | | | | | `PyObject*` (GH-99444) (cherry picked from commit bc390dd93574c3c6773958c6a7e68adc83d0bf3f) Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* gh-99181: fix except* on unhashable exceptions (GH-99192)Miss Islington (bot)2022-11-081-17/+26
| | | | | (cherry picked from commit c43714fbcdb9bb0927872d6ebf5697edd2e2a1e9) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-98852: Fix subscription of type aliases (GH-98920)Miss Islington (bot)2022-11-011-0/+7
| | | | | | | | Fix subscription of type aliases containing bare generic types or types like TypeVar: for example tuple[A, T][int] and tuple[TypeVar, T][int], where A is a generic type, and T is a type variable. (cherry picked from commit 0e15c31c7e9907fdbe38a3f419b669fed5bb3b33) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-98783: Fix crashes when `str` subclasses are used in ↵Dennis Sweeney2022-10-301-2/+2
| | | | | | | | `_PyUnicode_Equal` (GH-98806) (#98871) * gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` (GH-98806) (cherry picked from commit 76f989dc3e668d15b3ec9a90bf6530276530acac) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* obmalloc: Remove unused variable. (GH-98770)Miss Islington (bot)2022-10-271-3/+1
| | | | | (cherry picked from commit bded5edd9abf7ae6b2874916d70ec29ad209217c) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* gh-97943: PyFunction_GetAnnotations should return a borrowed reference. ↵Miss Islington (bot)2022-10-061-2/+5
| | | | | | | (GH-97949) (cherry picked from commit 6bfb0be80486c614cd60dce44c9fe7b3e6c76e3b) Co-authored-by: larryhastings <larry@hastings.org>
* gh-95196: Disable incorrect pickling of the C implemented classmethod ↵Miss Islington (bot)2022-10-051-1/+1
| | | | | | | descriptors (GH-96383) (cherry picked from commit 77f0249308de76401bf4f3c6a057789c92f862d1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] GH-97779: Ensure that *all* frame objects are backed by "complete" ↵Miss Islington (bot)2022-10-052-4/+34
| | | | | | | frames (GH-97886) (cherry picked from commit 0ff8fd65838f9f9ed90d7a055d26a2ce9fc0ce85) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>