summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-46541: Remove usage of _Py_IDENTIFIER from array module (GH-31376)Dong-hee Na2022-02-172-45/+139
|
* bpo-46541: Remove usage of _Py_IDENTIFIER from mmap module (GH-31375)Dong-hee Na2022-02-161-4/+1
|
* bpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351)Erlend Egeberg Aasland2022-02-165-39/+61
|
* bpo-46541: Remove usage of _Py_IDENTIFIER from csv module (GH-31372)Dong-hee Na2022-02-161-4/+10
|
* bpo-46541: Remove usage of _Py_IDENTIFIER from dbms modules (GH-31358)Dong-hee Na2022-02-162-6/+2
|
* bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)Guido van Rossum2022-02-152-1/+107
| | | | | | | | | | | | | | | | | asyncio/taskgroups.py is an adaptation of taskgroup.py from EdgeDb, with the following key changes: - Allow creating new tasks as long as the last task hasn't finished - Raise [Base]ExceptionGroup (directly) rather than TaskGroupError deriving from MultiError - Instead of monkey-patching the parent task's cancel() method, add a new public API to Task The Task class has a new internal flag, `_cancel_requested`, which is set when `.cancel()` is called successfully. The `.cancelling()` method returns the value of this flag. Further `.cancel()` calls while this flag is set return False. To reset this flag, call `.uncancel()`. Thus, a Task that catches and ignores `CancelledError` should call `.uncancel()` if it wants to be cancellable again; until it does so, it is deemed to be busy with uninterruptible cleanup. This new Task API helps solve the problem where TaskGroup needs to distinguish between whether the parent task being cancelled "from the outside" vs. "from inside". Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-46728: fix docstring of combinations_with_replacement for consistency ↵DongGeon Lee2022-02-152-4/+4
| | | | (GH-31293)
* bpo-46400: Update libexpat from 2.4.1 to 2.4.4 (GH-31022)Cyril Jouve2022-02-125-31/+237
|
* bpo-45948: Remove constructor discrepancy in C version of ↵Jacob Walls2022-02-122-5/+5
| | | | | ElementTree.XMLParser (GH-31152) Both implementations accept target=None now.
* bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)Petr Viktorin2022-02-1113-23/+23
| | | | | * Make PyType_GetModuleByDef public (remove underscore) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-46323: Fix double-free issue for borrowed refs (GH-31272)Dong-hee Na2022-02-111-1/+0
|
* bpo-44953: Add vectorcall for itemgetter and attrgetter instances (GH-27828)Dennis Sweeney2022-02-101-12/+78
|
* bpo-46323: Allow alloca(0) for python callback function of ctypes (GH-31249)Dong-hee Na2022-02-101-5/+1
|
* bpo-46323: Reduce stack usage of ctypes python callback function. (GH-31224)Dong-hee Na2022-02-092-27/+14
|
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-0843-334/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
* bpo-46323: Use PyObject_Vectorcall while calling ctypes callback function ↵Dong-hee Na2022-02-081-38/+40
| | | | (GH-31138)
* bpo-46323 Fix ref leak if ctypes.CFuncPtr raises an error. (GH-31209)Dong-hee Na2022-02-081-0/+1
|
* bpo-46670: Fix #ifdef in sha3module.c (GH-31180)Victor Stinner2022-02-071-1/+3
| | | | | | * Test if HAVE_ALIGNED_REQUIRED is defined, not its value. * Define explicitly NOT_PYTHON macro to 0. Fix "gcc -Wundef" warnings.
* bpo-46670: Remove unused macros in the Modules directory (GH-31194)Victor Stinner2022-02-076-14/+0
| | | | | * bpo-46670: Remove unused macros in the Modules directory * Add again LINKAT_DIR_FD_CONVERTER: generated by Argument Clinic
* bpo-39277: Fix PY_TIMEOUT_MAX cast in _threadmodule.c (GH-31195)Victor Stinner2022-02-071-1/+1
| | | | | | | | | | | | Cast PY_TIMEOUT_MAX to double, not to _PyTime_t. Fix the clang warning: Modules/_threadmodule.c:1648:26: warning: implicit conversion from '_PyTime_t' (aka 'long') to 'double' changes value from 9223372036854775 to 9223372036854776 [-Wimplicit-const-int-float-conversion] double timeout_max = (_PyTime_t)PY_TIMEOUT_MAX * 1e-6; ^~~~~~~~~~~~~~~~~~~~~~~~~ ~
* bpo-46323: _ctypes.CFuncPtr fails if _argtypes_ is too long (GH-31188)Victor Stinner2022-02-073-10/+17
| | | | | | | | | ctypes.CFUNCTYPE() and ctypes.WINFUNCTYPE() now fail to create the type if its "_argtypes_" member contains too many arguments. Previously, the error was only raised when calling a function. Change also how CFUNCTYPE() and WINFUNCTYPE() handle KeyError to prevent creating a chain of exceptions if ctypes.CFuncPtr raises an error.
* bpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153)Zackery Spytz2022-02-071-0/+1
| | | va_end() must be called before returning.
* bpo-46670: Test if a macro is defined, not its value (GH-31178)Victor Stinner2022-02-075-12/+12
| | | | | | | | * audioop.c: #ifdef WORDS_BIGENDIAN * ctypes.h: #ifdef USING_MALLOC_CLOSURE_DOT_C * _ctypes/malloc_closure.c: #ifdef HAVE_FFI_CLOSURE_ALLOC and #ifdef USING_APPLE_OS_LIBFFI * pytime.c: #ifdef __APPLE__ * unicodeobject.c: #ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION
* bpo-40280: Address more test failures on Emscripten (GH-31050)Christian Heimes2022-02-054-4/+14
| | | Co-authored-by: Brett Cannon <brett@python.org>
* closes bpo-46626: Expose IP_BIND_ADDRESS_NO_PORT socket option. (GH-31106)Benjamin Peterson2022-02-031-0/+3
|
* bpo-46433: _PyType_GetModuleByDef: handle static types in MRO (GH-30696)Petr Viktorin2022-02-022-4/+52
| | | Automerge-Triggered-By: GH:encukou
* bpo-45459: Add Py_buffer to limited API (GH-29991)Christian Heimes2022-02-021-1/+51
| | | | | | | | | | | - [x] ``Py_buffer`` struct - [x] ``PyBuffer_*()`` API functions - [x] ``PyBUF_*`` constants - [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots - [x] ``PyMemoryView_FromBuffer()`` API - [x] tests for limited API - [x] ``make regen-limited-abi`` - [x] documentation update - [ ] export ``PyPickleBuffer*()`` API ???
* Remove Python 3.3 compatibility code from overlapped.c (GH-31049)Kumar Aditya2022-02-021-6/+0
|
* bpo-46417: signal: move siginfo_type to the module state (GH-30964)Victor Stinner2022-01-271-19/+20
|
* bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)Victor Stinner2022-01-272-3/+3
| | | | | | | | Convert the PyType_SUPPORTS_WEAKREFS() macro to a regular function. It no longer access the PyTypeObject.tp_weaklistoffset member directly. Add _PyType_SUPPORTS_WEAKREFS() static inline functions, used internally by Python for best performance.
* bpo-43853: Expand test suite for SQLite UDF's (GH-27642)Erlend Egeberg Aasland2022-01-262-3/+14
|
* bpo-46513: Remove AC_C_CHAR_UNSIGNED / __CHAR_UNSIGNED__ (GH-30851)Christian Heimes2022-01-261-7/+0
|
* bpo-29882: Fix portability bug introduced in GH-30774 (#30794)Mark Dickinson2022-01-231-0/+1
|
* bpo-46417: Clear _io module static objects at exit (GH-30807)Victor Stinner2022-01-221-44/+93
| | | | Add _PyIO_Fini() function, called by finalize_interp_clear(). It clears static objects used by the _io extension module.
* bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)Kumar Aditya2022-01-221-16/+2
| | | | | | | | | | | | * bpo-46469: Make asyncio generic classes return GenericAlias * 📜🤖 Added by blurb_it. * Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-46249: Move set lastrowid out of the sqlite3 query loop (GH-30489)Erlend Egeberg Aasland2022-01-221-11/+11
|
* bpo-46417: Add _PyType_GetSubclasses() function (GH-30761)Victor Stinner2022-01-211-9/+9
| | | | | | | | | | | | | | Add a new _PyType_GetSubclasses() function to get type's subclasses. _PyType_GetSubclasses(type) returns a list which holds strong refererences to subclasses. It is safer than iterating on type->tp_subclasses which yields weak references and can be modified in the loop. _PyType_GetSubclasses(type) now holds a reference to the tp_subclasses dict while creating the list of subclasses. set_collection_flag_recursive() of _abc.c now uses _PyType_GetSubclasses().
* bpo-30512: Add CAN Socket support for NetBSD (GH-30066)Thomas Klausner2022-01-212-3/+7
|
* bpo-46417: signal uses PyStructSequence_NewType() (GH-30735)Victor Stinner2022-01-211-7/+9
| | | | | | The signal module now creates its struct_siginfo type as a heap type using PyStructSequence_NewType(), rather than using a static type. Add 'siginfo_type' member to the global signal_state_t structure.
* bpo-46417: _curses uses PyStructSequence_NewType() (GH-30736)Victor Stinner2022-01-211-12/+10
| | | | | | | | The _curses module now creates its ncurses_version type as a heap type using PyStructSequence_NewType(), rather than using a static type. * Move _PyStructSequence_FiniType() definition to pycore_structseq.h. * test.pythoninfo: log curses.ncurses_version.
* bpo-46417: time module uses PyStructSequence_NewType() (GH-30734)Victor Stinner2022-01-211-37/+81
| | | | | | | | | | The time module now creates its struct_time type as a heap type using PyStructSequence_NewType(), rather than using a static type. * Add a module state to the time module: add traverse, clear and free functions. * Use PyModule_AddType(). * Remove the 'initialized' variable.
* bpo-46417: _thread uses PyStructSequence_NewType() (GH-30733)Victor Stinner2022-01-211-12/+14
| | | | | The _thread module now creates its _ExceptHookArgs type as a heap type using PyStructSequence_NewType(), rather than using a static type.
* bpo-41857: mention timeout argument units in select.poll() and ↵Zane Bitter2022-01-202-3/+15
| | | | select.depoll() doc-strings (GH-22406)
* bpo-46028: Calculate base_executable by resolving symlinks in a venv (GH-30144)Steve Dower2022-01-181-1/+12
|
* bpo-46361: Fix "small" `int` caching (GH-30583)Brandt Bucher2022-01-161-0/+7
|
* bpo-46258: Streamline isqrt fast path (#30333)Mark Dickinson2022-01-151-14/+43
|
* bpo-46383: Fix signature of zoneinfo module_free function (GH-30607)Christian Heimes2022-01-151-1/+1
|
* bpo-46280: Fix tracemalloc_copy_domain() (GH-30591)Victor Stinner2022-01-141-0/+3
| | | | Test if tracemalloc_copy_traces() failed to allocated memory in tracemalloc_copy_domain().
* bpo-45953: Statically initialize all the non-object PyInterpreterState ↵Eric Snow2022-01-141-15/+11
| | | | | fields we can. (gh-30589) https://bugs.python.org/issue45953
* bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)neonene2022-01-132-5/+46
| | | This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.