summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* build(deps-dev): bump types-psutil from 5.9.5.20240516 to 6.0.0.20240621 in ↵dependabot[bot]2024-07-011-1/+1
| | | | | | /Tools (#121215) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* gh-121200: Log pwd entry in test_expanduser_pwd2() (#121207)Victor Stinner2024-07-011-6/+7
| | | | Use subTest() to log the pwd entry in test_expanduser_pwd2() of test_posixpath to help debugging.
* gh-121084: Call _abc_registry_clear() when checking refleaks (#121191)Victor Stinner2024-07-011-3/+7
| | | | dash_R_cleanup() now calls _abc_registry_clear() before calling again register().
* gh-61103: Support double complex (_Complex) type in ctypes (#120894)Sergey B Kirpichev2024-07-0117-17/+316
| | | | | | | | | | | | | | | | | | Example: ```pycon >>> import ctypes >>> ctypes.__STDC_IEC_559_COMPLEX__ 1 >>> libm = ctypes.CDLL('libm.so.6') >>> libm.clog.argtypes = [ctypes.c_double_complex] >>> libm.clog.restype = ctypes.c_double_complex >>> libm.clog(1+1j) (0.34657359027997264+0.7853981633974483j) ``` Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-121199: Use _Py__has_attribute() in timemodule.c (#121203)Victor Stinner2024-07-012-2/+2
| | | | | Use the _Py__has_attribute() macro in timemodule.c and bootstrap_hash.c to fix a build error on old GCC versions (GCC 4.8.5 on s390x).
* gh-121188: Sanitize invalid XML characters in regrtest (#121195)Victor Stinner2024-07-014-5/+91
| | | | | When creating the JUnit XML file, regrtest now escapes characters which are invalid in XML, such as the chr(27) control character used in ANSI escape sequences.
* gh-113565: Improve and harden detection of curses dependencies (#119816)Erlend E. Aasland2024-07-017-716/+550
| | | | | | | | | | | | | | 1. Use pkg-config to check for ncursesw/panelw. If that fails, use pkg-config to check for ncurses/panel. 2. Regardless of pkg-config output, search for curses/panel headers, so we're sure we have all defines in pyconfig.h. 3. Regardless of pkg-config output, check if libncurses or libncursesw contains the 'initscr' symbol; if it does _and_ pkg-config failed earlier, add the resulting -llib linker option to CURSES_LIBS. Ditto for 'update_panels' and PANEL_LIBS. 4. Wrap the rest of the checks with WITH_SAVE_ENV and make sure we're using updated LIBS and CPPFLAGS for those. Add the PY_CHECK_CURSES convenience macro.
* gh-87744: fix waitpid race while calling send_signal in asyncio (#121126)Kumar Aditya2024-07-013-9/+42
| | | asyncio earlier relied on subprocess module to send signals to the process, this has some drawbacks one being that subprocess module unnecessarily calls waitpid on child processes and hence it races with asyncio implementation which internally uses child watchers. To mitigate this, now asyncio sends signals directly to the process without going through the subprocess on non windows systems. On Windows it fallbacks to subprocess module handling but on windows there are no child watchers so this issue doesn't exists altogether.
* gh-121163: Add "all" as an valid alias for "always" in ↵Kirill Podoprigora2024-06-305-43/+49
| | | | | | warnings.simplefilter() (#121164) Add support for ``all`` as an valid alias for ``always`` in ``warnings.simplefilter()`` and ``warnings.filterswarnings()``.
* [doc] Update element positions and styles in logging flow diagram. (GH-121182)Vinay Sajip2024-06-301-132/+155
| | | Update element positions and styles.
* gh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (#121178)Yureka2024-06-301-7/+3
|
* gh-120522: Add a `--with-app-store-compliance` configure option to patch out ↵Russell Keith-Magee2024-06-309-2/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | problematic code (#120984) * Add --app-store-compliance configuration option. * Added blurb. * Correct tab-vs-spaces formatting issue. * Correct source file name in docs. Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> * Correct source code reference in Mac docs Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> * Only apply the patch forward, and ensure the working directory is correct. * Make patching reslient to multiple builds. * Documentation fixes found during review Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com> * Documentation and configure.ac syntax improvements Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> * Regenerate configure script. * Silence the patch echo output. --------- Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-119054: Add alt text to pathlib inheritance diagram (#121158)Barney Gale2024-06-291-0/+6
| | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* GH-119054: Add "Expanding and resolving paths" section to pathlib docs. ↵Barney Gale2024-06-291-101/+101
| | | | | | | | | | | | | | | | | | (#120970) Add dedicated subsection for `home()`, `expanduser()`, `cwd()`, `absolute()`, `resolve()` and `readlink()`. The position of this section keeps all the `Path` constructors (`Path()`, `Path.from_uri()`, `Path.home()` and `Path.cwd()`) near the top. Within the section, closely related methods are kept adjacent. Specifically: -.`home()` and `expanduser()` (the former calls the latter) - `cwd()` and `absolute()` (the former calls the latter) - `absolute()` and `resolve()` (both make paths absolute) - `resolve()` and `readlink()` (both read symlink targets) - Ditto `cwd()` and `absolute()` - Ditto `absolute()` and `resolve()` The "Other methods" section is removed.
* gh-119372: Recover inf's and zeros in _Py_c_quot (GH-119457)Sergey B Kirpichev2024-06-293-2/+56
| | | | | | In some cases, previously computed as (nan+nanj), we could recover meaningful component values in the result, see e.g. the C11, Annex G.5.2, routine _Cdivd().
* gh-121101: Document -Wall option (an alias for -Walways) (#121102)Wim Jeantine-Glenn2024-06-292-0/+3
|
* gh-120713: Normalize year with century for datetime.strftime (GH-120820)blhsing2024-06-297-16/+174
|
* gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c ↵Justin Applegate2024-06-281-0/+2
| | | | | (#121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
* gh-117139: Fix a few wrong steals in bytecodes.c (GH-121127)Ken Jin2024-06-284-33/+33
| | | Fix a few wrong steals in bytecodes.c
* gh-121115: Skip __index__ in PyLong_AsNativeBytes by default (GH-121118)Steve Dower2024-06-285-9/+33
|
* gh-121018: Fix more cases of exiting in argparse when exit_on_error=False ↵Serhiy Storchaka2024-06-283-16/+59
| | | | | | | | | (GH-121056) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true.
* Check for compiler warnings in test_cext on Windows (#121088)Victor Stinner2024-06-285-5/+18
| | | | | | | | On Windows, test_cext and test_cppext now pass /WX flag to the MSC compiler to treat all compiler warnings as errors. In verbose mode, these tests now log the compiler commands to help debugging. Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a compiler warning about an unnamed structure.
* gh-120804: remove `is_active` method from internal child watchers ↵Kumar Aditya2024-06-281-6/+0
| | | | implementation in asyncio (#121124)
* gh-121096: Ignore dlopen() leaks in Valgrind suppression file (#121097)Victor Stinner2024-06-281-0/+43
|
* gh-107803: add whatsnew for asyncio double linked list implementation (#120995)Kumar Aditya2024-06-281-0/+8
|
* gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051)Donghee Na2024-06-271-2/+36
|
* gh-121035: Update logging flow chart to include the lastResort handler. ↵Alexander Bessman2024-06-273-2/+283
| | | | (GH-121036)
* gh-121065: Temporarily skip flaky test on free-threaded build (#121100)Sam Gross2024-06-271-0/+1
|
* gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887)Craig Robson2024-06-272-3/+5
| | | | | | | | | The check for whether the log file is a real file is expensive on NFS filesystems. This commit reorders the rollover condition checking to not do the file type check if the expected file size is less than the rotation threshold. Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* gh-115986 Improve pprint docs formatting (GH-117401)Kerim Kabirov2024-06-271-91/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | * Move pprinter parameters description to the table The change improves readability. Suggested in the GH#116085 PR discussion. * Make pprint doc with params markup * Fix formatting Indentation of code blocks made them nested "Version changed" is better placed after the code block * Fix formatting for tests * fix code indentation for autotests * Fix identation for autotests * Remove duplication of the parameters' description * Rearrange parameters description in a correct order --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-121027: Add a future warning in functools.partial.__get__ (#121086)Serhiy Storchaka2024-06-277-17/+75
|
* gh-121082: Fix build failure when the developer use `--enable-pystats` ↵Nadeshiko Manju2024-06-272-2/+4
| | | | | | | | arguments in configuration command after #118450 (#121083) Signed-off-by: Manjusaka <me@manjusaka.me> Co-authored-by: Ken Jin <kenjin4096@gmail.com>
* gh-120593: Check -Wcast-qual flag in test_cext (#121081)Victor Stinner2024-06-271-0/+3
| | | | Check the usage of the 'const' qualifier in the Python C API in test_cext.
* gh-120686: remove unused internal c api functions (#120687)Irit Katriel2024-06-277-54/+0
|
* gh-121040: Use __attribute__((fallthrough)) (#121044)Victor Stinner2024-06-2729-104/+131
| | | | | | | | | | | | | Fix warnings when using -Wimplicit-fallthrough compiler flag. Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if available. Replace "fall through" comments with _Py_FALLTHROUGH. Add _Py__has_attribute() macro. No longer define __has_attribute() macro if it's not defined. Move also _Py__has_builtin() at the top of pyport.h. Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
* gh-120888: Bump bundled pip to 24.1.1 (#120889)Pradyun Gedam2024-06-274-1/+2
| | | | | | | Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com> Co-authored-by: T. Wouters <thomas@python.org>
* gh-119521: Remove _IncompleteInputError from the docs (GH-120993)Petr Viktorin2024-06-272-1/+3
|
* gh-120868: Fix breaking change in `logging.config` when using `QueueHandler` ↵Janek Nouvertné2024-06-273-17/+81
| | | | (GH-120872)
* gh-113433: Automatically Clean Up Subinterpreters in Py_Finalize() (gh-121060)Eric Snow2024-06-263-9/+151
| | | This change makes things a little less painful for some users. It also fixes a failing assert (gh-120765), by making sure all subinterpreters are destroyed before the main interpreter. As part of that, we make sure Py_Finalize() always runs with the main interpreter active.
* gh-120937: Reference weakref from the `__del__` documentation (#120940)chaen2024-06-261-0/+2
| | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-117139: Convert the evaluation stack to stack refs (#118450)Ken Jin2024-06-2635-3745/+5215
| | | | | | | | | | | | | | | | | This PR sets up tagged pointers for CPython. The general idea is to create a separate struct _PyStackRef for everything on the evaluation stack to store the bits. This forces the C compiler to warn us if we try to cast things or pull things out of the struct directly. Only for free threading: We tag the low bit if something is deferred - that means we skip incref and decref operations on it. This behavior may change in the future if Mark's plans to defer all objects in the interpreter loop pans out. This implies a strict stack reference discipline is required. ALL incref and decref operations on stackrefs must use the stackref variants. It is unsafe to untag something then do normal incref/decref ops on it. The new incref and decref variants are called dup and close. They mimic a "handle" API operating on these stackrefs. Please read Include/internal/pycore_stackref.h for more information! --------- Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com>
* gh-118908: Use __main__ for the default PyREPL namespace (#121054)Łukasz Langa2024-06-264-67/+75
|
* gh-120593: Fix const qualifier in _PyLong_CompactValue() (#121053)Victor Stinner2024-06-263-6/+6
| | | | | | | | | | | | | | | | | | Remove the const qualifier of the argument of functions: * _PyLong_IsCompact() * _PyLong_CompactValue() Py_TYPE() argument is not const. Fix the compiler warning: Include/cpython/longintrepr.h: In function ‘_PyLong_CompactValue’: Include/pyport.h:19:31: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual] (...) Include/cpython/longintrepr.h:133:30: note: in expansion of macro ‘Py_TYPE’ assert(PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS));
* gh-120593: Fix const qualifier in pyatomic.h (#121055)Victor Stinner2024-06-261-4/+4
|
* gh-121008: Fix idlelib.run tests (#121046)Victor Stinner2024-06-261-6/+13
| | | | When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook.
* gh-119786: move frames documentation to InternalDocs and add details (#121009)Irit Katriel2024-06-262-55/+38
|
* gh-120642: Move private PyCode APIs to the internal C API (#120643)Victor Stinner2024-06-2618-227/+212
| | | | | | | | | | | | | | | * Move _Py_CODEUNIT and related functions to pycore_code.h. * Move _Py_BackoffCounter to pycore_backoff.h. * Move Include/cpython/optimizer.h content to pycore_optimizer.h. * Remove Include/cpython/optimizer.h. * Remove PyUnstable_Replace_Executor(). Rename functions: * PyUnstable_GetExecutor() => _Py_GetExecutor() * PyUnstable_GetOptimizer() => _Py_GetOptimizer() * PyUnstable_SetOptimizer() => _Py_SetTier2Optimizer() * PyUnstable_Optimizer_NewCounter() => _PyOptimizer_NewCounter() * PyUnstable_Optimizer_NewUOpOptimizer() => _PyOptimizer_NewUOpOptimizer()
* gh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (#121017)devdanzin2024-06-263-1/+32
|
* gh-121040: Remove fallthrough warnings compiler option (gh-121041)Nate Ohlson2024-06-262-40/+0
| | | Remove fallthrough warnings
* gh-73991: Skip permission test if running as *nix superuser (GH-120994)Petr Viktorin2024-06-261-0/+1
|