| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
gh-110045: Update symtable module for PEP 695 (GH-110066)
(cherry picked from commit 7dc2c5093ef027aab57bca953ac2d6477a4a440b)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#109545)
gh-109496: Detect Py_DECREF() after dealloc in debug mode (GH-109539)
On a Python built in debug mode, Py_DECREF() now calls
_Py_NegativeRefcount() if the object is a dangling pointer to
deallocated memory: memory filled with 0xDD "dead byte" by the debug
hook on memory allocators. The fix is to check the reference count
*before* checking for _Py_IsImmortal().
Add test_decref_freed_object() to test_capi.test_misc.
(cherry picked from commit 0bb0d88e2d4e300946e399e088e2ff60de2ccf8c)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
| |
set (GH-109014) (#109023)
[3.12] C API tests: use special markers to test that output parameters were set (GH-109014).
(cherry picked from commit bf414b7fcb7c8ba780a5e1d9f320ecef0c7f9488)
|
|
|
|
|
|
|
| |
(GH-107131) (GH-107487)" (#108864)
This reverts commit 54aaaadef8a44324f6be674707c67a3516470ff6.
Co-authored-by: T. Wouters <thomas@python.org>
|
|
|
|
|
|
|
|
| |
Add Modules/_testcapi/util.h header (GH-108774)
It contains common macros used in C API tests.
(cherry picked from commit 0e01fac315dfa705ac8a6954485546f28cf4c87d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(#108655)
(cherry picked from commit 8178a88bd81edae87d6974483e4de9b32e808797)
- Add param docstrings
- Link to os.SEEK_* constants
- Mention the return value in the initial paragraph
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
|
|
| |
(cherry picked from commit 38afa4af9bfc8297a5ee270c37f3f120a04297ea)
|
|
|
|
|
|
|
|
| |
messages (GH-108073) (#108540)
Clarify distinction between datetime module and class in deprecation messages (GH-108073)
(cherry picked from commit 09343dba44cdb5c279ec51df34552ef451434958)
Co-authored-by: Clément Robert <cr52@protonmail.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>
|
|
|
|
|
|
|
|
|
|
|
| |
(#107933) (#108262)
(cherry picked from commit 7f87ebbc3f52680c939791f397b9a478edf0c8d4)
Clearly document the supported seek() operations:
- Rewind to the start of the stream
- Restore a previous stream position (given by tell())
- Fast-forward to the end of the stream
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyErr_Format() (GH-107918) (#108134)
* gh-107915: Handle errors in C API functions PyErr_Set*() and PyErr_Format() (GH-107918)
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)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Define PY_SSIZE_T_CLEAN.
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and .close() (#108084) (#108141)
- Add explanatory comments
- Add return value to connection_close() for propagating errors
- Always check the return value of connection_exec_stmt()
- Assert pre/post state in remove_callbacks()
- Don't log unraisable exceptions in case of interpreter shutdown
- Make sure we're not initialized if reinit fails
- Try to close the database even if ROLLBACK fails
(cherry picked from commit fd195092204aa7fc9f13c5c6d423bc723d0b3520)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
- name the last parameter *whence*, like it is for seek() methods on
file objects
- add param docstrings
- structure the valid *whence* params
(cherry picked from commit dd4442c8f597af1ec3eaf20f7ad89c4ac7e2dbc9)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
| |
* gh-106242: Fix path truncation in os.path.normpath (GH-106816)
* gh-106242: Minor fixup to avoid compiler warnings
---------
Co-authored-by: Finn Womack <flan313@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-107179) (#107728)
Cover all the Mapping Protocol, almost all the Sequence Protocol
(except PySequence_Fast) and a part of the Object Protocol.
Move existing tests to Lib/test/test_capi/test_abstract.py and
Modules/_testcapi/abstract.c.
Add also tests for PyDict C API..
(cherry picked from commit 16c9415fba4972743f1944ebc44946e475e68bc4)
|
|
|
|
|
|
| |
PySys_SetObject() (GH-107736) (#107740)
[3.12] gh-107735: Add C API tests for PySys_GetObject() and PySys_SetObject() (GH-107736).
(cherry picked from commit bea5f93196d213d6fbf4ba8984caf4c3cd1da882)
|
|
|
|
|
|
|
|
|
|
| |
* Strings with length from 2**31-1 to 2**32-2 always caused MemoryError,
it doesn't matter how much memory is available.
* Strings with length exactly 2**32-1 caused OSError.
* Strings longer than 2**32-1 characters were truncated due to integer overflow bug.
* Strings containing the null character were truncated at the first null character.
Now strings longer than 2**31-1 characters caused OverflowError and the null character is allowed..
(cherry picked from commit 04cc01453db2f0af72a06440831637f8bf512daf)
|
|
|
|
|
|
|
|
|
|
| |
quantifiers (GH-102612) (#108003)
Restore the global Input Stream pointer after trying to match a sub-pattern.
.
(cherry picked from commit abd9cc52d94b8e2835322b62c29f09bb0e6fcfe9)
Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(GH-107821) (#107835)
gh-91054: make code watcher tests resilient to other watchers (GH-107821)
(cherry picked from commit 2ec16fed14aae896e38dd5bd9e73e2eddc974439)
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
|
|
| |
via SSL_ERROR_SYSCALL (GH-107586) (#107587)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
|
|
|
|
|
|
|
| |
(#… (#107491)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
(cherry picked from commit 3979150a0d406707f6d253d7c15fb32c1e005a77)
|
|
|
|
|
|
|
| |
(#107487)
(cherry picked from commit 08447b5deb47e2a0df87fa0a0576d300e5c909b4)
Co-authored-by: Konstantin <kpp.live+github@gmail.com>
|
|
|
|
|
|
|
|
| |
(#107414)
* Check for linux/limits.h before including it
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit 11c055f5ff1a353de6d2e77f2af24aaa782878ba)
|
|
|
|
|
|
|
|
|
|
| |
gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433)
Fix potential unaligned memory access on C APIs involving returned sequences
of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These
were revealed using a ``-fsaniziter=alignment`` build on ARM macOS.
(cherry picked from commit f01e4cedba1a17d321664834bb255d9d04ad16ce)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
|
|
|
|
|
|
|
|
| |
(gh-105258) (gh-107303)
The _xxsubinterpreters module was meant to only use public API. Some internal C-API usage snuck in over the last few years (e.g. gh-28969). This fixes that.
(cherry picked from commit e6373c0d8b59512aa7f0dea7f3fb162b6ed10fa4)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
|
| |
(GH-106351) (GH-107258)
(cherry picked from commit b5ae7c498438657a6ba0bf4cc216b9c2c93a06c7)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
|
|
|
|
|
|
|
| |
initializer (GH-106862) (GH-106953)
(cherry picked from commit 8d397ee8259fa0f81598a452438fc335267ca260)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
(GH-106768) (GH-106855)
Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
(cherry picked from commit 3e65baee72131b49f4ce8ca2da568a6f2001ce93)
|
|
|
|
|
|
| |
_curses_panel, _decimal, posix, xxsubtype (GH-106767) (#106849)
(cherry picked from commit 745492355b94d109e47827e5865846f25ae42d26)
|
|
|
|
|
|
|
|
| |
(GH-106832) (#106835)
gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (GH-106832)
(cherry picked from commit ebf2c56b33553a448da8f60fcd89a622f071b5f4)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-106687: _ssl: use uint64_t for SSL options (GH-106700)
SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html
Fix this compiler warning on Windows with MSC:
conversion from 'uint64_t' to 'long', possible loss of data
(cherry picked from commit ad95c7253a70e559e7d3f25d53f4772f28bb8b44)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-105252) (#106708)
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)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
| |
Add tests for codecs.
(cherry picked from commit 51ea664d18938645521bdd128a3c55f9c197644c)
|
|
|
|
|
|
|
|
|
|
| |
gh-105227: Add PyType_GetDict() (GH-105747)
This compensates for static builtin types having `tp_dict` set to `NULL`.
(cherry picked from commit a840806d338805fe74a9de01081d30da7605a29f)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
|
|
| |
Some items remained uninitialized if _sre.template() was called with invalid
indices. Then attempt to clear them in the destructor led to dereferencing
of uninitialized pointer.
(cherry picked from commit 2ef1dc37f02b08536b677dd23ec51541a60effd7)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(GH-106286) (#106365)
gh-91053: make func watcher tests resilient to other func watchers (GH-106286)
(cherry picked from commit 58906213cc5d8f2be311664766b4923ef29dae1f)
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
|
| |
GH-106152: Add PY_THROW event to cProfile (GH-106161)
(cherry picked from commit cea9d4ea82abcb2c6f1d83a2fe819859da4bbda4)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
|
|
|
|
|
|
|
|
| |
(#106099)
[3.12] gh-105987: Fix reference counting issue in `_asyncio._swap_current_task` (GH-105989).
(cherry picked from commit d2cbb6e918d9ea39f0dd44acb53270f2dac07454)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
(#106041)
[3.12] 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)
|
|
|
|
| |
For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
(cherry picked from commit 757b402)
|
|
|
|
|
|
|
|
| |
(gh-105731)
We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
(cherry picked from commit b97e14a806477af4225777d215ac38c0d9b845f0)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
|
|
| |
(#105667) (#105720)
Prevent exceptions from possibly being overwritten in case of multiple
failures.
(cherry picked from commit 217589d4f3246d67c6ef0eb0be2b1c33987cf260)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-105686) (#105710)
All fields must be explicitly initialised to prevent manipulation of
uninitialised fields in dealloc.
Align initialisation order with the layout of the object structs.
(cherry picked from commit ca3cc4b95d66f7527ebe0ba4cdb1907082d9bfc8)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
|
| |
values (GH-105495) (#105700)
gh-105436: The environment block should end with two null wchar_t values (GH-105495)
(cherry picked from commit 4f7d3b602d47d61137e82145f601dccfe6f6cd3c)
Co-authored-by: Dora203 <66343334+sku2000@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(GH-105386) (GH-105697)
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
(cherry picked from commit 2b90796be6959d5ef46b38c434a514fce25be971)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
| |
(cherry picked from commit 20a56d8becba1a5a958b167fdb43b1a1b9228095)
Add proper error handling to add_errors_module() to prevent exceptions
from possibly being overwritten.
|
|
|
|
|
|
|
| |
Prevent repeated PyLong_FromVoidPtr() from possibly overwriting the
current exception.
(cherry picked from commit e8998e46a7ce8ad336e0941a6da6e50cb88d1e47)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Fix a bug where an IndexError could end up being overwritten.
(cherry picked from commit f668f73bc88cce0112b304d87aa998fb28013c71)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Fix a bug where an exception could end up being overwritten.
(cherry picked from commit c932f7284977ebf813313157c52d716ba225a7ac)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
| |
Improve error handling so init bails on the first exception.
(cherry picked from commit 16d49680b56e00c53c00683b949138e584669fd3)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|