summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-108634: PyInterpreterState_New() no longer calls Py_FatalError() (#108748)Victor Stinner2023-09-017-51/+99
| | | | | | | | | | | | pycore_create_interpreter() now returns a status, rather than calling Py_FatalError(). * PyInterpreterState_New() now calls Py_ExitStatusException() instead of calling Py_FatalError() directly. * Replace Py_FatalError() with PyStatus in init_interpreter() and _PyObject_InitState(). * _PyErr_SetFromPyStatus() now raises RuntimeError, instead of ValueError. It can now call PyErr_NoMemory(), raise MemoryError, if it detects _PyStatus_NO_MEMORY() error message.
* gh-108727: Fix segfault due to missing tp_dealloc definition for ↵Irit Katriel2023-09-013-0/+10
| | | | CounterOptimizer_Type (GH-108734)
* gh-107805: Fix signatures of module-level generated functions in `turtle` ↵Nikita Sobolev2023-09-013-19/+45
| | | | | (#107807) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-106320: Remove private _PyLong_Sign() (#108743)Victor Stinner2023-09-014-15/+23
| | | | | | Move the private _PyLong_Sign() and _PyLong_NumBits() functions to the internal C API (pycore_long.h). Modules/_testcapi/long.c now uses the internal C API.
* `ast` docs: Fix incorrect link on `keyword` (#108728)Alex Povel2023-08-311-2/+2
| | | In two places, Sphinx was erroneously adding links to the `keyword` module instead of the `ast.keyword` class
* gh-107603: Argument Clinic: Only include pycore_gc.h if needed (#108726)Victor Stinner2023-08-31131-727/+448
| | | | | | | | | | | | | | | | | | | | Argument Clinic now only includes pycore_gc.h if PyGC_Head is needed, and only includes pycore_runtime.h if _Py_ID() is needed. * Add 'condition' optional argument to Clinic.add_include(). * deprecate_keyword_use() includes pycore_runtime.h when using the _PyID() function. * Fix rendering of includes: comments start at the column 35. * Mark PC/clinic/_wmimodule.cpp.h and "Objects/stringlib/clinic/*.h.h" header files as generated in .gitattributes. Effects: * 42 header files generated by AC no longer include the internal C API, instead of 4 header files before. For example, Modules/clinic/_abc.c.h no longer includes the internal C API. * Fix _testclinic_depr.c.h: it now always includes pycore_runtime.h to get _Py_ID().
* gh-108337: Add pyatomic.h header (#108701)Victor Stinner2023-08-3117-4/+3049
| | | | | | | | This adds a new header that provides atomic operations on common data types. The intention is that this will be exposed through Python.h, although that is not the case yet. The only immediate use is in the test file. Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-108638: Fix tests when _stat extension is missing (#108689)Victor Stinner2023-08-312-7/+29
| | | | Fix test_inspect and test_pydoc when the _stat extension is missing. Skip tests relying on _stat when _stat is missing.
* gh-108682: [Enum] raise TypeError if super().__new__ called in custom ↵Ethan Furman2023-08-314-56/+260
| | | | | | | | | | | __new__ (GH-108704) When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. . member = object.__new__(cls) member = int.__new__(cls, value) member = str.__new__(cls, value) Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.
* gh-108634: Py_TRACE_REFS uses a hash table (#108663)Victor Stinner2023-08-3131-243/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python built with "configure --with-trace-refs" (tracing references) is now ABI compatible with Python release build and debug build. Moreover, it now also supports the Limited API. Change Py_TRACE_REFS build: * Remove _PyObject_EXTRA_INIT macro. * The PyObject structure no longer has two extra members (_ob_prev and _ob_next). * Use a hash table (_Py_hashtable_t) to trace references (all objects): PyInterpreterState.object_state.refchain. * Py_TRACE_REFS build is now ABI compatible with release build and debug build. * Limited C API extensions can now be built with Py_TRACE_REFS: xxlimited, xxlimited_35, _testclinic_limited. * No longer rename PyModule_Create2() and PyModule_FromDefAndSpec2() functions to PyModule_Create2TraceRefs() and PyModule_FromDefAndSpec2TraceRefs(). * _Py_PrintReferenceAddresses() is now called before finalize_interp_delete() which deletes the refchain hash table. * test_tracemalloc find_trace() now also filters by size to ignore the memory allocated by _PyRefchain_Trace(). Test changes for Py_TRACE_REFS: * Add test.support.Py_TRACE_REFS constant. * Add test_sys.test_getobjects() to test sys.getobjects() function. * test_exceptions skips test_recursion_normalizing_with_no_memory() and test_memory_error_in_PyErr_PrintEx() if Python is built with Py_TRACE_REFS. * test_repl skips test_no_memory(). * test_capi skisp test_set_nomemory().
* gh-97850: Note in py312 whatsnew that `importlib.util.set_loader` and ↵Alex Waygood2023-08-311-2/+3
| | | | | `importlib.util.module_for_loader` have been removed (#108719) Note in py312 whatsnew that `importlib.util.set_loader` and `importlib.util.module_for_loader` have been removed
* gh-106320: winconsoleio.c includes pycore_pyerrors.h (#108720)Victor Stinner2023-08-311-0/+1
| | | | | Fix compiler warning: warning C4013: '_PyErr_ChainExceptions1' undefined
* Run make regen-global-objects (#108714)Victor Stinner2023-08-314-30/+0
|
* gh-106320: Remove private _PyErr_ChainExceptions() (#108713)Victor Stinner2023-08-3118-117/+140
| | | | | | | | | | | | | Remove _PyErr_ChainExceptions(), _PyErr_ChainExceptions1() and _PyErr_SetFromPyStatus() functions from the public C API. * Move the private _PyErr_ChainExceptions() and _PyErr_ChainExceptions1() function to the internal C API (pycore_pyerrors.h). * Move the private _PyErr_SetFromPyStatus() to the internal C API (pycore_initconfig.h). * No longer export the _PyErr_ChainExceptions() function. * Move run_in_subinterp_with_config() from _testcapi to _testinternalcapi.
* GH-108614: Remove non-debug uses of `#if TIER_ONE` and `#if TIER_TWO` from ↵Mark Shannon2023-08-317-66/+123
| | | | `_POP_FRAME` op. (GH-108685)
* gh-106320: Don't export _Py_ForgetReference() function (#108712)Victor Stinner2023-08-311-2/+8
| | | | | There is no need to export the _Py_ForgetReference() function of the Py_TRACE_REFS build. It's not used by shared extensions. Enhance also its comment.
* gh-107149: Make PyUnstable_ExecutableKinds public (#108440)Victor Stinner2023-08-313-14/+14
| | | | | | Move PyUnstable_ExecutableKinds and associated macros from the internal C API to the public C API. Rename constants: replace "PY_" prefix with "PyUnstable_" prefix.
* gh-108455: peg_generator: use `types-setuptools==68.1.0.1` in CI (#108697)Alex Waygood2023-08-313-11/+5
|
* gh-101100: Fix sphinx warnings in `threading.rst` (#108684)Nikita Sobolev2023-08-312-9/+8
| | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-108696: revert bypassing import cache in test_import helper (#108698)Carl Meyer2023-08-311-2/+1
|
* gh-108654: restore comprehension locals before handling exception (#108659)Carl Meyer2023-08-303-14/+90
| | | Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* gh-108297: Remove test_crashers (#108690)Victor Stinner2023-08-301-37/+0
| | | | | | | | | | The test was skipped in 2011 by commit 89ba56d5fb1335ef808b87cd33cba95ea141c65d. Scripts in Lib/test/crashers/ do not crash on a reliable way. They rely on undefined behaviors, like state of the stack memory, and so may or may not crash. It is not worth it to make sure that they crash in a continious integration, they should be run manually time to time instead.
* gh-108520: Fix bad fork detection in nested multiprocessing use case (#108568)albanD2023-08-303-3/+34
| | | | | | | | gh-107275 introduced a regression where a SemLock would fail being passed along nested child processes, as the `is_fork_ctx` attribute would be left missing after the first deserialization. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr>
* gh-108590: Revert gh-108657 (commit 400a1cebc) (#108686)Erlend E. Aasland2023-08-303-41/+2
| | | Reverted per Serhiy's request.
* gh-108494: Argument Clinic: Document how to generate code that uses the ↵Victor Stinner2023-08-302-2/+24
| | | | | | limited C API (#108584) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Document Python build requirements (#108646)Victor Stinner2023-08-302-6/+23
| | | | Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-101100: Fix Sphinx warnings in the Logging Cookbook (#108678)Hugo van Kemenade2023-08-302-5/+11
|
* Fix typo in multiprocessing docs (#108666)kato89662023-08-301-1/+1
|
* gh-108669: unittest: Fix documentation for TestResult.collectedDurations ↵Sebastian Rittau2023-08-301-1/+1
| | | | (#108670)
* gh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (#108657)Corvin2023-08-303-2/+41
| | | Co-authored-by: Erlend E. Aasland <erlend@python.org>
* Revert "gh-103224: Use the realpath of the Python executable in `test_venv` ↵Serhiy Storchaka2023-08-301-5/+3
| | | | | | | (GH-103243)" (GH-108667) This reverts commit 85b0b0cd947c5218260fb2bc2014c8c8de172d33. It broke builtbots.
* gh-106320: Remove private _Py_ForgetReference() (#108664)Victor Stinner2023-08-302-5/+5
| | | | Move the private _Py_ForgetReference() function to the internal C API (pycore_object.h).
* Mention Ellipsis pickling in the docs (#103660)sterliakov2023-08-301-1/+2
|
* Revert "Use non alternate name for Kyiv (GH-108533)" (GH-108649)Serhiy Storchaka2023-08-291-1/+1
| | | | | This reverts commit 7659128b9d7a30ddbcb063bc12e2ddb0f1f119e0. It broke tests on the Debian and macOS buildbots.
* gh-108278: Deprecate passing the first param of sqlite3.Connection callback ↵Erlend E. Aasland2023-08-297-22/+206
| | | | | | | | | | | | APIs by keyword (#108632) Deprecate passing the callback callable by keyword for the following sqlite3.Connection APIs: - set_authorizer(authorizer_callback) - set_progress_handler(progress_handler, ...) - set_trace_callback(trace_callback) The affected parameters will become positional-only in Python 3.15.
* gh-108455: peg_generator: install two stubs packages before running mypy ↵Alex Waygood2023-08-294-6/+17
| | | | (#108637)
* gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268)Erlend E. Aasland2023-08-293-14/+23
| | | | | | | - 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>
* gh-108488: Initialize JUMP_BACKWARD cache to 0, not 17 (#108591)Guido van Rossum2023-08-293-3/+6
| | | This mis-initialization caused the executor optimization to kick in sooner than intended. It also set the lower 4 bits of the counter to `1` -- those bits are supposed to be reserved (the actual counter is in the upper 12 bits).
* gh-107557: Remove unnecessary SAVE_IP instructions (#108583)Guido van Rossum2023-08-295-231/+392
| | | | | Also remove NOP instructions. The "stubs" are not optimized in this fashion (their SAVE_IP should always be preserved since it's where to jump next, and they don't contain NOPs by their nature).
* test_sys: remove debug print() (#108642)Victor Stinner2023-08-291-1/+0
|
* gh-108638: Fix stat.filemode() when _stat is missing (#108639)Victor Stinner2023-08-292-3/+13
| | | | | | Change the pure Python implementation of stat.filemode() for unknown file type: use "?", as done by the _stat.filemode(). test_stat skips TestFilemodeCStat if the _stat extension is missing.
* Use non alternate name for Kyiv (GH-108533)Jochen Sprickerhof2023-08-291-1/+1
| | | | | | | | | | | tzdata provides Kiev as an alternative to Kyiv: https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314#L314 But Debian moved it to the tzdata-legacy package breaking the test: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530 This patch switches to the name provided by tzdata.
* gh-108635: Make parameters of some implementations of special methods ↵Serhiy Storchaka2023-08-298-254/+36
| | | | positional-only (GH-108636)
* gh-108455: peg generator: Use `strict_optional=True` for `grammar_parser` ↵Nikita Sobolev2023-08-292-4/+1
| | | | (#108629)
* gh-108623: Fix compile warning in `Modules/_multiprocessing/semaphore.c` ↵Nikita Sobolev2023-08-291-0/+5
| | | | (#108624)
* gh-108494: Don't build _testclinic_limited with TraceRefs (#108608)Victor Stinner2023-08-293-1/+46
| | | | | If Python is built with ./configure --with-trace-refs, don't build the _testclinic_limited extension. The limited C API (Py_LIMITED_API) is not compatible with Py_TRACE_REFS.
* gh-108494: Argument Clinic: fix option group for Limited C API (#108574)Victor Stinner2023-08-291-3/+9
| | | Use PyTuple_Size() instead of PyTuple_GET_SIZE().
* gh-108455: peg_generator: make the mypy config slightly stricter (#108627)Alex Waygood2023-08-294-8/+12
| | | | | | | | | * Enable `--no-implicit-reexport` * Enable the `truthy-bool` error code * Enable the `ignore-without-code` error code * Explicitly note that `--warn-unreachable` cannot yet be enabled
* gh-108455: Simplify the peg_generator mypy config (#108620)Alex Waygood2023-08-291-18/+8
| | | make it easier to see exactly which options from mypy's `--strict` mode can't currently be enabled
* gh-108617: Extend interactive session tests for sqlite3 (GH-108556)Serhiy Storchaka2023-08-291-6/+32
|