| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
(#122327)
Don't delivery PyDict_EVENT_ADDED until it can't fail
|
| |
|
|
|
| |
The tests were only checking cases where the slot wrapper was present in the initial case. They were missing when the slot wrapper was added in the additional initializations. This fixes that.
(cherry-picked from commit 490e0ad83ac72c5688dfbbab4eac61ccfd7be5fd, AKA gh-122248)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In gh-121602, I applied a fix to a builtin types initialization bug.
That fix made sense in the context of some broader future changes,
but introduced a little bit of extra complexity. For earlier versions
those future changes are not relevant; we can avoid the extra complexity.
Thus we can revert that earlier change and replace it with this one,
which is more focused and conceptually simpler. This is essentially
the implementation of an idea that @markshannon pointed out to me.
Note that this change would be much smaller if we didn't have to deal
with repr compatibility for builtin types that explicitly inherit tp slots
(see expect_manually_inherited()). The alternative is to stop
*explicitly* inheriting tp slots in static PyTypeObject values,
which is churn that we can do separately.
(cherry picked from commit 716c6771fcfd3be90bba9f888a579b36c02cdb13, AKA gh-121932)
|
| |
|
|
|
| |
point" (GH-121907) (GH-122013)
(cherry picked from commit 1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356)
|
| |
|
|
|
|
|
| |
* The result has type Py_ssize_t, not intptr_t.
* Type cast between unsigned and signed integer types should be explicit.
* Downcasting should be explicit.
* Fix integer overflow check in sum().
(cherry picked from commit 1801545)
|
| |
|
|
|
|
|
|
| |
(GH-121661) (#121762)
gh-121660: Fix `ga_getitem` by explicitly checking for `NULL` result (GH-121661)
(cherry picked from commit bb802db8cfa35a88582be32fae05fe1cf8f237b1)
Co-authored-by: sobolevn <mail@sobolevn.me>
|
| |
|
|
|
|
|
| |
When builtin static types are initialized for a subinterpreter, various "tp" slots have already been inherited (for the main interpreter). This was interfering with the logic in add_operators() (in Objects/typeobject.c), causing a wrapper to get created when it shouldn't. This change fixes that by preserving the original data from the static type struct and checking that.
(cherry picked from commit 5250a031332eb9499d5fc190d7287642e5a144b9, AKA gh-121602)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
| |
|
|
|
|
|
|
| |
free_list to be reused (gh-121428) (#121566)
GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428)
(cherry picked from commit 9585a1a2a251aaa15baf6579e13dd3be0cb05f1f)
Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
(GH-120442) (#120825)
gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (GH-120442)
(cherry picked from commit 8334a1b55c93068f5d243852029baa83377ff6c9)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| | |
|
| |
|
|
|
| |
active (GH-120195)
Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
|
| |
|
|
|
|
|
|
|
| |
(#120339)
gh-120298: Fix use-after-free in `list_richcompare_impl` (GH-120303)
(cherry picked from commit 141babad9b4eceb83371bf19ba3a36b50dd05250)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
correctly (GH-2487) (GH-120312)
(cherry picked from commit 4829522b8d3e1a28930f1cccfcc9635e035a0eb4)
Co-authored-by: E. M. Bray <erik.bray@lri.fr>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-120228) (#120240)
gh-120155: Fix copy/paste error in HAVE_SUBOFFSETS_IN_LAST_DIM() (GH-120228)
Don't hardcode 'dest' in HAVE_SUBOFFSETS_IN_LAST_DIM() macro of
memoryobject.c, but use its 'view' parameter instead.
Fix the Coverity issue:
Error: COPY_PASTE_ERROR (CWE-398):
Python-3.12.2/Objects/memoryobject.c:273:14: original: ""dest->suboffsets + (dest->ndim - 1)"" looks like the original copy.
Python-3.12.2/Objects/memoryobject.c:274:14: copy_paste_error: ""dest"" in ""src->suboffsets + (dest->ndim - 1)"" looks like a copy-paste error.
Python-3.12.2/Objects/memoryobject.c:274:14: remediation: Should it say ""src"" instead?
GH- 272| assert(dest->ndim > 0 && src->ndim > 0);
GH- 273| return (!HAVE_SUBOFFSETS_IN_LAST_DIM(dest) &&
GH- 274|-> !HAVE_SUBOFFSETS_IN_LAST_DIM(src) &&
GH- 275| dest->strides[dest->ndim-1] == dest->itemsize &&
GH- 276| src->strides[src->ndim-1] == src->itemsize);
(cherry picked from commit 90b75405260467814c93738a3325645918d4ea51)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-119687) (ПР-119805)
* Remove the equivalence with real+imag*1j which can be incorrect in corner
cases (non-finite numbers, the sign of zeroes).
* Separately document the three roles of the constructor: parsing a string,
converting a number, and constructing a complex from components.
* Document positional-only parameters of complex(), float(), int() and bool()
as positional-only.
* Add examples for complex() and int().
* Specify the grammar of the string for complex().
* Improve the grammar of the string for float().
* Describe more explicitly the behavior when real and/or imag arguments are
complex numbers. (This will be deprecated in future.)
(cherry picked from commit ec1ba264607b2b7b98d2602f5536a1d02981efc6)
|
| |
|
|
|
|
|
| |
(GH-119296) (#119681)
(cherry picked from commit 6b240c2308a044e38623900ccb8fa58c3549d4ae)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
| |
(cherry picked from commit 7e6fcab20003b07621dc02ea78d6ea2fda500371)
Co-authored-by: Steve Dower <steve.dower@python.org>
|
| |
|
|
| |
closed (#118451)
|
| |
|
|
|
|
|
| |
(GH-117882) (#118458)
GH-117881: fix athrow().throw()/asend().throw() concurrent access (GH-117882)
(cherry picked from commit fc7e1aa3c001bbce25973261fba457035719a559)
|
| |
|
|
|
|
| |
StopIteration (GH-117851) (GH-118226)
(cherry picked from commit 7d369d471cf2b067c4d795d70b75201c48b46f5b)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
exit (GH-116677) (#117029)
Starting in Python 3.12, we prevented calling fork() and starting new threads
during interpreter finalization (shutdown). This has led to a number of
regressions and flaky tests. We should not prevent starting new threads
(or `fork()`) until all non-daemon threads exit and finalization starts in
earnest.
This changes the checks to use `_PyInterpreterState_GetFinalizing(interp)`,
which is set immediately before terminating non-daemon threads.
(cherry picked from commit 60e105c1c11ecca1680d03c38aa06bcc77a28714)
|
| |
|
|
|
|
|
|
|
| |
(#116722)
gh-116714: Handle errors correctly in `PyFloat_GetInfo` (GH-116715)
(cherry picked from commit fcd49b4f47f1edd9a2717f6619da7e7af8ea73cf)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
| |
`longobject` (GH-116599) (#116648)
gh-110819: Fix ‘kind’ may be used uninitialized warning in `longobject` (GH-116599)
(cherry picked from commit eb947cdc1374842a32fa82249ba3c688abf252dc)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
|
|
|
| |
(#116299)
(cherry picked from commit 17c4849981905fb1c9bfbb2b963b6ee12e3efb2c)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
|
| |
|
|
|
|
| |
gh-100762: Fix optimization in gen_close (GH-111069)
(cherry picked from commit 0db2517687efcf5ec0174a32398ec1564b3204f1)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
| |
|
|
|
| |
(GH-115619) (GH-115620)
(cherry picked from commit 090dd21ab9379d6a2a6923d6cbab697355fb7165)
|
| |
|
|
| |
(gh-115471)
|
| |
|
|
|
|
|
| |
(GH-113562) (GH-114644)
(cherry picked from commit 11c582235d86b6020710eff282eeb381a7bf7bb7)
Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
|
| |
|
|
|
|
| |
(cherry picked from commit 60ca37fdee52cc4ff318b6e9ddbb260e8583b33b)
Co-authored-by: Mano Sriram <mano.sriram0@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
| |
|
|
|
| |
(cherry-picked from commit f1f839243251fef7422c31d6a7c3c747e0b5e27c)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
| |
|
|
|
|
| |
docstrings (GH-113355) (#113379)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
|
| |
|
|
|
|
|
|
|
| |
… (#112827)
gh-112125: Fix None.__ne__(None) returning NotImplemented instead of False (#112504)
(cherry picked from commit 9c3458e05865093dd55d7608810a9d0ef0765978)
Co-authored-by: andrewluotechnologies <44252973+andrewluotechnologies@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
inside bytearray.join (GH-112626) (GH-112693)
(cherry picked from commit 0e732d0997cff08855d98c17af4dd5527f10e419)
Co-authored-by: chilaxan <chilaxan@gmail.com>
|
| |
|
|
| |
coroutine/generator. (GH-112428) (#112589)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
subinterpreter (gh-110911) (gh-111238)
Fixes GH-109894
* set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call
* allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init
---------
(cherry picked from commit 47d3e2ed930a9f3d228aed4f62133737dae74cf7)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
(gh-110713)
We tried this before with a dict and for all interned strings. That ran into problems due to interpreter isolation. However, exclusively using a per-interpreter cache caused some inconsistency that can eliminate the benefit of interning. Here we circle back to using a global cache, but only for statically allocated strings. We also use a more-basic _Py_hashtable_t for that global cache instead of a dict.
Ideally we would only have the global cache, but the optional isolation of each interpreter's allocator means that a non-static string object must not outlive its interpreter. Thus we would have to store a copy of each such interned string in the global cache, tied to the main interpreter.
(cherry-picked from commit b72947a8d26915156323ccfd04d273199ecb870c)
|
| | |
|
| |
|
|
|
|
|
|
| |
`__weakref__` docstrings (GH-112268) (#112270)
gh-112266: Remove `(if defined)` part from `__dict__` and `__weakref__` docstrings (GH-112268)
(cherry picked from commit f8129146ef9e1b71609ef4becc5d508061970733)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
|
|
|
| |
(GH-110586) (#111866)
gh-110543: Fix CodeType.replace in presence of comprehensions (GH-110586)
(cherry picked from commit 0b718e6407da65b838576a2459d630824ca62155)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
| |
(cherry picked from commit 6640f1d8d2462ca0877e1d2789e1721767e9caf2)
Co-authored-by: Savannah Ostrowski <sostrowski@microsoft.com>
|
| |
|
|
|
|
|
|
| |
(GH-110784) (#110787)
gh-110782: Fix crash when TypeVar is constructed with keyword args (GH-110784)
(cherry picked from commit d2a536b1706d4a79303b7ac53684bb82eac2de23)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
|
| |
Fix typos in docs and comments (#109619)
Co-authored-by: Heinz-Alexander Fuetterer <35225576+afuetterer@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
| |
(#109097)
gh-108732: include comprehension locals in frame.f_locals (GH-109026)
(cherry picked from commit f2584eade378910b9ea18072bb1dab3dd58e23bb)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-109044). (#109061)
* [3.12] 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>
* re-clinic
---------
Co-authored-by: Daniel Weiss <134341009+justdan6@users.noreply.github.com>
|
| |
|
|
|
|
| |
gh-108295: Fix crashes with TypeVar weakrefs (GH-108517)
(cherry picked from commit 482fad7f01567447b7259ebf58d62999fcdc5964)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(#108523)
gh-107913: Fix possible losses of OSError error codes (GH-107930)
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)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
* [3.12] gh-86457: Fix signature for code.replace() (GH-23199)
Also add support of @text_signature in Argument Clinic..
(cherry picked from commit 0e6e32fb84b2f7cb668e0b9927637587081e38cd)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Update 2023-08-07-16-30-48.gh-issue-95065.-im4R5.rst
|
| |
|
|
|
|
|
|
|
|
|
| |
(#107751)
* Unrevert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)".
This reverts commit 6e4eec760648a71e1cd8f8f551997b1823b4bb9f (gh-107648).
* Initialize each interpreter's refchain properly.
* Skip test_basic_multiple_interpreters_deleted_no_reset on tracerefs builds.
|
| |
|
|
|
|
|
|
|
|
| |
tp_new (GH-107834) (#107864)
gh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834)
(cherry picked from commit 16dcce21768ba381996a88ac8c255bf1490b3680)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
| |
|
|
|
|
|
| |
Isolated Subinterpreters (gh-107567) (#107599)" (#107648)
Revert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)"
This reverts commit 58af2293c52a1ad3754d254690c0e54f787c545b.
|