summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-108765: Python.h no longer includes <sys/time.h> (#108775)Victor Stinner2023-09-0211-37/+43
| | | | | | | | | Python.h no longer includes <time.h>, <sys/select.h> and <sys/time.h> standard header files. * Add <time.h> include to xxsubtype.c. * Add <sys/time.h> include to posixmodule.c and semaphore.c. * readline.c includes <sys/select.h> instead of <sys/time.h>. * resource.c no longer includes <time.h> and <sys/time.h>.
* GH-78722: Raise exceptions from `pathlib.Path.iterdir()` without delay. ↵Barney Gale2023-09-023-3/+4
| | | | | | | (#107320) `pathlib.Path.iterdir()` now immediately raises any `OSError` exception from `os.listdir()`, rather than waiting until its result is iterated over.
* gh-108765: Python.h no longer includes <unistd.h> (#108783)Victor Stinner2023-09-0216-42/+55
|
* gh-108794: doctest counts skipped tests (#108795)Victor Stinner2023-09-025-67/+175
| | | | | | | | | | | | * Add 'skipped' attribute to TestResults. * Add 'skips' attribute to DocTestRunner. * Rename private DocTestRunner._name2ft attribute to DocTestRunner._stats. * Use f-string for string formatting. * Add some tests. * Document DocTestRunner attributes and its API for statistics. * Document TestResults class. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-108765: Python.h no longer includes <ieeefp.h> (#108781)Victor Stinner2023-09-027-16/+12
| | | | Remove also the HAVE_IEEEFP_H macro: remove ieeefp.h from the AC_CHECK_HEADERS() check of configure.ac.
* gh-108765: Remove old prototypes from pyport.h (#108782)Victor Stinner2023-09-024-30/+22
| | | | | | | Move prototypes of gethostname(), _getpty() and struct termios from pyport.h to the C code using them: posixmodule.c, socketmodule.c and termios.c. Replace "#ifdef SOLARIS" with "#ifdef __sun".
* gh-101100: Fix sphinx warnings in `unittest.mock-examples.rst` (#108810)Nikita Sobolev2023-09-023-8/+8
|
* Fix typo in `uuid.rst` (#108809)Nikita Sobolev2023-09-021-1/+1
|
* gh-101100: Fix sphinx warnings in `uuid.rst` (#108805)Nikita Sobolev2023-09-022-22/+30
| | | | | * gh-101100: Fix sphinx warnings in `uuid.rst` * Use anchors
* gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421)Serhiy Storchaka2023-09-0232-8/+57
| | | | Only mark tests which spend significant system or user time, by itself or in subprocesses.
* gh-108777: Split _PyTime tests from _testinternalcapi.c (gh-108787)Sam Gross2023-09-0211-262/+313
|
* Fix test_regrtest when run with uops always on (#108778)Guido van Rossum2023-09-011-3/+7
| | | | | | | The fix has two parts: - When `-X uops` is detected, pass it on to the subprocess created to run the manufactured test. I need this so I can run `./python -Xuops -m test test_regrtest` and see it fail without the next fix. - Use `-R 6:3:` in `ArgsTestCase.test_huntrleaks` instead of `-R 3:3:` -- it takes longer to settle with `-X uops`.
* gh-106392: Fix inconsistency in deprecation warnings (#106436)William Andrea2023-09-011-2/+2
| | | They used "datetime" to refer to both the object and the module.
* gh-107862: Add roundtrip `hypothesis` tests to `test_binascii` (#107863)Nikita Sobolev2023-09-011-3/+49
|
* gh-105509: Simplify implementation of `typing.Annotated` (#105510)Alex Waygood2023-09-013-27/+17
|
* gh-105563: reference DateType in datetime's documentation (#105946)TATHAGATA ROY2023-09-011-0/+4
|
* Improve some C API documentation (GH-108768)Serhiy Storchaka2023-09-013-62/+51
| | | | | | * Express functions which take argument as a C string in terms of functions which take Python object. * Use "note" directive for PyMapping_HasKey() and PyMapping_HasKeyString() notes.
* gh-108765: Move standard includes to Python.h (#108769)Victor Stinner2023-09-0110-59/+43
| | | | | | | | | | | | * Move <ctype.h>, <limits.h> and <stdarg.h> standard includes to Python.h. * Move "pystats.h" include from object.h to Python.h. * Remove redundant "pymem.h" include in objimpl.h and "pyport.h" include in pymem.h; Python.h already includes them earlier. * Remove redundant <wchar.h> include in unicodeobject.h; Python.h already includes it. * Move _SGI_MP_SOURCE define from Python.h to pyport.h. * pycore_condvar.h includes explicitly <unistd.h> for the _POSIX_THREADS macro.
* Add Modules/_testcapi/util.h header (GH-108774)Serhiy Storchaka2023-09-017-94/+49
| | | It contains common macros used in C API tests.
* gh-108767: Replace ctype.h functions with pyctype.h functions (#108772)Victor Stinner2023-09-016-36/+36
| | | | | | | | | | | | | | Replace <ctype.h> locale dependent functions with Python "pyctype.h" locale independent functions: * Replace isalpha() with Py_ISALPHA(). * Replace isdigit() with Py_ISDIGIT(). * Replace isxdigit() with Py_ISXDIGIT(). * Replace tolower() with Py_TOLOWER(). Leave Modules/_sre/sre.c unchanged, it uses locale dependent functions on purpose. Include explicitly <ctype.h> in _decimal.c to get isascii().
* gh-108765: Reformat Include/pymacconfig.h (#108764)Victor Stinner2023-09-011-77/+69
| | | Replace "MacOSX" with "macOS".
* gh-108765: Reformat Include/osdefs.h (#108766)Victor Stinner2023-09-011-21/+27
|
* Make test_fcntl quiet (#108758)Victor Stinner2023-09-011-31/+32
| | | | | | Running test_fcntl logs two "struct.pack: ..." lines because multiprocessing imports test_fcntl twice with test.support.verbose=1. Move get_lockdata() inside TestFcntl test case and only call it where it's needed, to stop logging these lines.
* gh-101100: Fix sphinx warnings in `tutorial/appendix.rst` (#108750)Nikita Sobolev2023-09-012-5/+4
| | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-101100: Fix sphinx warnings in `tutorial/classes.rst` (#108746)Nikita Sobolev2023-09-012-2/+1
|
* 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>