summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535)Erlend Egeberg Aasland2021-02-161-1/+1
|
* bpo-43181: Convert PyObject_TypeCheck to static inline function (GH-24533)Erlend Egeberg Aasland2021-02-151-2/+5
|
* bpo-43166: Disable ceval.c optimisations for Windows debug builds (GH-24485)Steve Dower2021-02-091-3/+3
| | | | This ensures that ceval.c can be debugged. Also remove some irrelevant options from the pragma.
* bpo-35295: Remove outdated comment. (GH-24453)Inada Naoki2021-02-051-7/+0
|
* Post 3.10.0a5Pablo Galindo2021-02-031-1/+1
|
* Fix Sphynx syntax in the memory.rst documentv3.10.0a5Pablo Galindo2021-02-021-2/+2
|
* bpo-42990: Further refactoring of PyEval_ functions. (GH-24368)Mark Shannon2021-02-013-18/+7
| | | | | | | | | | * Further refactoring of PyEval_EvalCode and friends. Break into make-frame, and eval-frame parts. * Simplify function vector call using new _PyEval_Vector. * Remove unused internal functions: _PyEval_EvalCodeWithName and _PyEval_EvalCode. * Don't use legacy function PyEval_EvalCodeEx.
* bpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed ↵Serhiy Storchaka2021-01-311-1/+1
| | | | wchar_t (GH-24350)
* bpo-42990: Introduce 'frame constructor' struct to simplify API for ↵Mark Shannon2021-01-293-13/+24
| | | | | | | PyEval_CodeEval and friends (GH-24298) * Introduce 'frame constructor' to simplify API for frame creation * Embed struct using a macro to conform to PEP 7
* bpo-42979: Enhance abstract.c assertions checking slot result (GH-24352)Victor Stinner2021-01-272-1/+7
| | | | | | | | * bpo-42979: Enhance abstract.c assertions checking slot result Add _Py_CheckSlotResult() function which fails with a fatal error if a slot function succeeded with an exception set or failed with no exception set: write the slot name, the type name and the current exception (if an exception is set).
* bpo-40176: Improve error messages for unclosed string literals (GH-19346)Batuhan Taskaya2021-01-201-2/+0
| | | Automerge-Triggered-By: GH:isidentical
* bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)Victor Stinner2021-01-191-1/+1
|
* bpo-42923: Dump extension modules on fatal error (GH-24207)Victor Stinner2021-01-182-0/+8
| | | | | | | The Py_FatalError() function and the faulthandler module now dump the list of extension modules on a fatal error. Add _Py_DumpExtensionModules() and _PyModule_IsExtension() internal functions.
* bpo-42923: Py_FatalError() avoids fprintf() (GH-24242)Victor Stinner2021-01-181-7/+3
| | | | | * Replace buffered fprintf() with unbuffered _Py_write_noraise() in Py_FatalError(). * _Py_DumpHexadecimal() now accepts uintptr_t.
* bpo-41994: Fix refcount issues in Python/import.c (GH-22632)Serhiy Storchaka2021-01-122-7/+0
| | | https://bugs.python.org/issue41994
* bpo-42882: _PyRuntimeState_Init() leaves unicode next_index unchanged (GH-24193)Victor Stinner2021-01-121-0/+4
| | | | | | | | Fix the _PyUnicode_FromId() function (_Py_IDENTIFIER(var) API) when Py_Initialize() / Py_Finalize() is called multiple times: preserve _PyRuntime.unicode_ids.next_index value. Use _PyRuntimeState_INIT macro instead memset(0) to reset _PyRuntimeState members to zero.
* bpo-41798: Allocate _decimal extension module C API on the heap (GH-24117)Erlend Egeberg Aasland2021-01-061-1/+3
|
* bpo-42823: Fix frame lineno when frame.f_trace is set (GH-24099)Mark Shannon2021-01-051-6/+1
| | | | | | | | | * Add test for frame.f_lineno with/without tracing. * Make sure that frame.f_lineno is correct regardless of whether frame.f_trace is set. * Update importlib * Add NEWS
* Post 3.10.0a4Pablo Galindo2021-01-041-1/+1
|
* Python 3.10.0a4v3.10.0a4Pablo Galindo2021-01-041-2/+2
|
* bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999)Petr Viktorin2020-12-291-3/+3
| | | | | | | | | | | | | | | ``` In file included from /usr/include/python3.8/Python.h:147: In file included from /usr/include/python3.8/abstract.h:837: /usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *' (aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)') increases required alignment from 1 to 8 [-Werror,-Wcast-align] ptr = (vectorcallfunc*)(((char *)callable) + offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` Co-Authored-By: Andreas Schneider <asn@cryptomilk.org> Co-Authored-By: Antoine Pitrou <antoine@python.org>
* bpo-40521: Per-interpreter interned strings (GH-20085)Victor Stinner2020-12-261-0/+11
| | | | | | | | | | | Make the Unicode dictionary of interned strings compatible with subinterpreters. Remove the INTERN_NAME_STRINGS macro in typeobject.c: names are always now interned (even if EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined). _PyUnicode_ClearInterned() now uses PyDict_Next() to no longer allocate memory, to ensure that the interned dictionary is cleared.
* bpo-42745: Make the type cache per-interpreter (GH-23947)Victor Stinner2020-12-263-1/+26
| | | | | | | | | | | Make the type attribute lookup cache per-interpreter. Add private _PyType_InitCache() function, called by PyInterpreterState_New(). Continue to share next_version_tag between interpreters, since static types are still shared by interpreters. Remove MCACHE macro: the cache is no longer disabled if the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.
* bpo-39465: Fix _PyUnicode_FromId() for subinterpreters (GH-20058)Victor Stinner2020-12-253-3/+18
| | | | | | | | | | | | | | | | | Make _PyUnicode_FromId() function compatible with subinterpreters. Each interpreter now has an array of identifier objects (interned strings decoded from UTF-8). * Add PyInterpreterState.unicode.identifiers: array of identifiers objects. * Add _PyRuntimeState.unicode_ids used to allocate unique indexes to _Py_Identifier. * Rewrite the _Py_Identifier structure. Microbenchmark on _PyUnicode_FromId(&PyId_a) with _Py_IDENTIFIER(a): [ref] 2.42 ns +- 0.00 ns -> [atomic] 3.39 ns +- 0.00 ns: 1.40x slower This change adds 1 ns per _PyUnicode_FromId() call in average.
* bpo-39465: Add pycore_atomic_funcs.h header (GH-20766)Victor Stinner2020-12-232-3/+97
| | | | | | Add pycore_atomic_funcs.h internal header file: similar to pycore_atomic.h but don't require to declare variables as atomic. Add _Py_atomic_size_get() and _Py_atomic_size_set() functions.
* bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly ↵Mark Shannon2020-12-171-1/+1
| | | | | | | | | after raising or reraising an exception (GH-23803) * Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626. * Update importlib * Add NEWS.
* bpo-42639: Move atexit state to PyInterpreterState (GH-23763)Victor Stinner2020-12-152-4/+18
| | | | | | | | | * Add _PyAtExit_Call() function and remove pyexitfunc and pyexitmodule members of PyInterpreterState. The function logs atexit callback errors using _PyErr_WriteUnraisableMsg(). * Add _PyAtExit_Init() and _PyAtExit_Fini() functions. * Remove traverse, clear and free functions of the atexit module. Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-42639: atexit now logs callbacks exceptions (GH-23771)Victor Stinner2020-12-142-1/+3
| | | | | | | | | | | At Python exit, if a callback registered with atexit.register() fails, its exception is now logged. Previously, only some exceptions were logged, and the last exception was always silently ignored. Add _PyAtExit_Call() function and remove PyInterpreterState.atexit_func member. call_py_exitfuncs() now calls directly _PyAtExit_Call(). The atexit module must now always be built as a built-in module.
* bpo-42639: Cleanup atexitmodule.c (GH-23770)Victor Stinner2020-12-142-7/+2
| | | | | | | | | * Rename "atexitmodule_state" to "struct atexit_state". * Rename "modstate" to "state". * Rename "self" parameter to "module". * test_atexit uses textwrap.dedent(). * Remove _Py_PyAtExit() function: inline it into atexit_exec(). * PyInterpreterState: rename pyexitfunc to atexit_func, rename pyexitmodule to atexit_module.
* bpo-42591: Export missing Py_FrozenMain() symbol (GH-23730)Victor Stinner2020-12-101-0/+2
| | | | | | | Export the Py_FrozenMain() function: fix a Python 3.9.0 regression. Python 3.9 uses -fvisibility=hidden and the function was not exported explicitly and so not exported. Add also Py_FrozenMain to the stable ABI on Windows.
* bpo-32381: Add _PyRun_AnyFileObject() (GH-23723)Victor Stinner2020-12-092-0/+10
| | | | | | | | | | pymain_run_file() no longer encodes the filename: pass the filename as an object to the new _PyRun_AnyFileObject() function. Add new private functions: * _PyRun_AnyFileObject() * _PyRun_InteractiveLoopObject() * _Py_FdIsInteractive()
* bpo-32381: Remove unused _Py_fopen() function (GH-23711)Victor Stinner2020-12-091-4/+0
| | | | Remove the private _Py_fopen() function which is no longer needed. Use _Py_wfopen() or _Py_fopen_obj() instead.
* bpo-32381: Add _PyRun_SimpleFileObject() (GH-23709)Victor Stinner2020-12-081-0/+5
| | | | pymain_run_startup() now pass the filename as a Python object to _PyRun_SimpleFileObject().
* bpo-35134: Add Include/cpython/pythonrun.h file (GH-23701)Victor Stinner2020-12-082-117/+124
| | | | | Py_CompileString() is now always declared as a function by Include/pythonrun.h. It is overriden with a macro in Include/cpython/pythonrun.h.
* Post 3.10.0a3Pablo Galindo2020-12-081-1/+1
|
* Python 3.10.0a3v3.10.0a3Pablo Galindo2020-12-071-2/+2
|
* bpo-30459: Cast the result of PyCell_SET to void (GH-23654)Victor Stinner2020-12-071-1/+1
|
* bpo-30459: Cast the result of PyList_SET_ITEM() to void (GH-19975)Zackery Spytz2020-12-052-2/+2
| | | Do the same for PyTuple_SET_ITEM().
* bpo-42262: Py_NewRef() casts its argument to PyObject* (GH-23626)Victor Stinner2020-12-031-4/+2
| | | Write also unit tests on Py_NewRef() and Py_XNewRef().
* bpo-42431: Fix outdated bytes comments (GH-23458)Serhiy Storchaka2020-12-033-25/+39
| | | | Also move definitions of internal macros F_LJUST etc to private header.
* bpo-42500: Fix recursion in or after except (GH-23568)Mark Shannon2020-12-022-18/+1
| | | * Use counter, rather boolean state when handling soft overflows.
* bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)Victor Stinner2020-12-012-3/+7
| | | | | | | | | No longer use deprecated aliases to functions: * Replace PyObject_MALLOC() with PyObject_Malloc() * Replace PyObject_REALLOC() with PyObject_Realloc() * Replace PyObject_FREE() with PyObject_Free() * Replace PyObject_Del() with PyObject_Free() * Replace PyObject_DEL() with PyObject_Free()
* bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586)Victor Stinner2020-12-012-26/+12
| | | | | | | | | | | No longer use deprecated aliases to functions: * Replace PyMem_MALLOC() with PyMem_Malloc() * Replace PyMem_REALLOC() with PyMem_Realloc() * Replace PyMem_FREE() with PyMem_Free() * Replace PyMem_Del() with PyMem_Free() * Replace PyMem_DEL() with PyMem_Free() Modify also the PyMem_DEL() macro to use directly PyMem_Free().
* bpo-40170: Hide impl detail of Py_TRASHCAN_BEGIN macro (GH-23235)Hai Shi2020-11-241-1/+3
| | | | | The Py_TRASHCAN_BEGIN macro no longer accesses PyTypeObject attributes, but now can get the condition by calling the new private _PyTrash_cond() function which hides implementation details.
* bpo-1635741: Convert _imp to multi-phase init (GH-23378)Victor Stinner2020-11-181-1/+1
| | | | | | | | | | | | Convert the _imp extension module to the multi-phase initialization API (PEP 489). * Add _PyImport_BootstrapImp() which fix a bootstrap issue: import the _imp module before importlib is initialized. * Add create_builtin() sub-function, used by _imp_create_builtin(). * Initialize PyInterpreterState.import_func earlier, in pycore_init_builtins(). * Remove references to _PyImport_Cleanup(). This function has been renamed to finalize_modules() and moved to pylifecycle.c.
* bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)Victor Stinner2020-11-181-9/+4
| | | | | | | | | This change partically reverts commit ad3252bad905d41635bcbb4b76db30d570cf0087 and the commit fe2978b3b940fe2478335e3a2ca5ad22338cdf9c. Many third party C extension modules rely on the ability of using Py_TYPE() to set an object type: "Py_TYPE(obj) = type;" or to set an object type using: "Py_SIZE(obj) = size;".
* bpo-41713: Remove PyOS_InitInterrupts() function (GH-23342)Victor Stinner2020-11-172-2/+2
| | | | | | | Remove the undocumented PyOS_InitInterrupts() C function. * Rename PyOS_InitInterrupts() to _PySignal_Init(). It now installs other signal handlers, not only SIGINT. * Rename PyOS_FiniInterrupts() to _PySignal_Fini()
* bpo-37205: time.time() cannot fail with fatal error (GH-23314)Victor Stinner2020-11-161-24/+28
| | | | | | | | | | | | | | | time.time(), time.perf_counter() and time.monotonic() functions can no longer fail with a Python fatal error, instead raise a regular Python exception on failure. Remove _PyTime_Init(): don't check system, monotonic and perf counter clocks at startup anymore. On error, _PyTime_GetSystemClock(), _PyTime_GetMonotonicClock() and _PyTime_GetPerfCounter() now silently ignore the error and return 0. They cannot fail with a Python fatal error anymore. Add py_mach_timebase_info() and win_perf_counter_frequency() sub-functions.
* bpo-41617: Add _Py__has_builtin() macro (GH-23260)Victor Stinner2020-11-132-9/+18
| | | | | | | | | | | Fix building pycore_bitutils.h internal header on old clang version without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7). Add a new private _Py__has_builtin() macro to check for availability of a preprocessor builtin function. Co-Authored-By: Joshua Root <jmr@macports.org> Co-authored-by: Joshua Root <jmr@macports.org>
* bpo-42260: Initialize time and warnings earlier at startup (GH-23249)Victor Stinner2020-11-123-3/+6
| | | | | | | | | | * Call _PyTime_Init() and _PyWarnings_InitState() earlier during the Python initialization. * Inline _PyImportHooks_Init() into _PySys_InitCore(). * The _warnings initialization function no longer call _PyWarnings_InitState() to prevent resetting filters_version to 0. * _PyWarnings_InitState() now returns an int and no longer clear the state in case of error (it's done anyway at Python exit). * Rework init_importlib(), fix refleaks on errors.