summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-82300: Add track parameter to multiprocessing.shared_memory (#110778)pan3242023-12-054-23/+106
| | | | | | | | | | Add a track parameter to shared memory to allow resource tracking via the side-launched resource tracker process to be disabled on platforms that use it (POSIX). This allows people who do not want automated cleanup at process exit because they are using the shared memory with processes not participating in Python's resource tracking to use the shared_memory API. Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Guido van Rossum <gvanrossum@gmail.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* Minor refactoring of Object/abstract.c (UNARY_FUNC macro and more cases for ↵Sergey B Kirpichev2023-12-051-90/+25
| | | | | | | BINARY_FUNC) (GH-112145) * Use BINARY_FUNC macro for some remaining ops * Add UNARY_FUNC macro to define unary PyNumber_* functions
* gh-102130: Support tab completion in cmd for Libedit. (GH-107748)Constantin Hong2023-12-055-1/+51
| | | | | --- Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* gh-112736: Refactor del-safe symbol handling in subprocess (#112738)Russell Keith-Magee2023-12-052-24/+25
| | | | | Refactor delete-safe symbol handling in subprocess. Only module globals are force-cleared during interpreter finalization, using a class reference instead of individually listing the constants everywhere is simpler.
* GH-112727: Speed up `pathlib.Path.absolute()` (#112728)Barney Gale2023-12-042-6/+15
| | | | | | Use `_from_parsed_parts()` to create a pre-joined/pre-parsed path, rather than passing multiple arguments to `with_segments()` Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-112334: Restore subprocess's use of `vfork()` & fix `extra_groups=[]` ↵Gregory P. Smith2023-12-043-23/+38
| | | | | | | | | | | | | | | | | | | | | behavior (#112617) Restore `subprocess`'s intended use of `vfork()` by default for performance on Linux; also fixes the behavior of `extra_groups=[]` which was unintentionally broken in 3.12.0: Fixed a performance regression in 3.12's :mod:`subprocess` on Linux where it would no longer use the fast-path ``vfork()`` system call when it could have due to a logic bug, instead falling back to the safe but slower ``fork()``. Also fixed a security bug introduced in 3.12.0. If a value of ``extra_groups=[]`` was passed to :mod:`subprocess.Popen` or related APIs, the underlying ``setgroups(0, NULL)`` system call to clear the groups list would not be made in the child process prior to ``exec()``. The security issue was identified via code inspection in the process of fixing the first bug. Thanks to @vain for the detailed report and analysis in the initial bug on Github. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-112535: Add test on _Py_ThreadId() (#112709)Victor Stinner2023-12-046-8/+75
| | | Add also test.support.Py_GIL_DISABLED constant.
* gh-112671: Fixing typo in the Macro Docs (GH-112715)Amioplk2023-12-041-1/+1
| | | Replace Py_T_STRING_INLINE with Py_T_STRING_INPLACE
* gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to ↵Gregory P. Smith2023-12-043-10/+30
| | | | | | | | | 1gig (#112615) Work around a macOS bug, limit zlib crc32 calls to 1GiB. Without this, `zlib.crc32` and `binascii.crc32` could produce incorrect results on multi-gigabyte inputs depending on the macOS version's Apple supplied zlib implementation.
* gh-103363: Add follow_symlinks argument to `pathlib.Path.owner()` and ↵Kamil Turek2023-12-045-24/+93
| | | | `group()` (#107962)
* gh-74690: Avoid a costly type check where possible in ↵Alex Waygood2023-12-043-6/+37
| | | | `_ProtocolMeta.__subclasscheck__` (#112717)
* gh-112516: Update bundled pip version to 23.3.1 (gh-112517)Thomas Bininda2023-12-043-1/+2
|
* gh-108927: Fix removing testing modules from sys.modules (GH-108952)Serhiy Storchaka2023-12-048-9/+67
| | | | | It breaks import machinery if the test module has submodules used in other tests.
* gh-74690: Optimise `isinstance()` and `issubclass()` calls against ↵Alex Waygood2023-12-042-3/+16
| | | | runtime-checkable protocols by avoiding costly `super()` calls (#112708)
* gh-101100: Fix Sphinx nitpicks in `library/abc.rst` (#112703)Alex Waygood2023-12-042-22/+21
|
* gh-109786: Fix leaks and crash when re-enter itertools.pairwise.__next__() ↵Serhiy Storchaka2023-12-043-2/+85
| | | | (GH-109788)
* gh-110275: Named tuple's __replace__() now raises TypeError for invalid ↵Serhiy Storchaka2023-12-045-7/+9
| | | | arguments (GH-110299)
* gh-65210: Add const qualifiers in PyArg_VaParseTupleAndKeywords() (GH-105958)Serhiy Storchaka2023-12-047-13/+57
| | | | | | | | | | | Change the declaration of the keywords parameter in functions PyArg_ParseTupleAndKeywords() and PyArg_VaParseTupleAndKeywords() from `char **` to `char * const *` in C and `const char * const *` in C++. It makes these functions compatible with argument of type `const char * const *`, `const char **` or `char * const *` in C++ and `char * const *` in C without explicit type cast. Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-101100: Fix Sphinx nitpicks in `library/functions.rst` (#112669)Alex Waygood2023-12-042-47/+67
|
* gh-106550: Fix sign conversion in pycore_code.h (#112613)Victor Stinner2023-12-041-10/+12
| | | | Fix sign conversion in pycore_code.h: use unsigned integers and cast explicitly when needed.
* bpo-34392: Add sys. _is_interned() (GH-8755)Serhiy Storchaka2023-12-046-1/+87
|
* gh-112625: Protect bytearray from being freed by misbehaving iterator inside ↵chilaxan2023-12-043-1/+22
| | | | bytearray.join (GH-112626)
* gh-112678: Declare `Tkapp_CallDeallocArgs()` as `static` (GH-112679)Christopher Chavez2023-12-041-1/+1
|
* gh-66819: More IDLE htest updates(4) (#112686)Terry Jan Reedy2023-12-0425-34/+62
| | | | Mostly double spacing before 'if __name__...'.
* gh-66819: More IDLE htest updates(3) (#112683)Terry Jan Reedy2023-12-046-26/+27
| | | Revise spec-callable pairs from percolator to end.
* GH-106747: Improve `Path.glob()` expectations in pathlib tests (#112365)Barney Gale2023-12-031-33/+33
| | | | | | | Add trailing slashes to expected `Path.glob()` results wherever a pattern has a trailing slash. This matches what `glob.glob()` produces. Due to another bug (GH-65238) pathlib strips all trailing slashes, so this change is academic for now.
* gh-101100: Fix Sphinx warning in `library/gettext.rst` (#112668)Hugo van Kemenade2023-12-032-8/+7
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-101100: Fix most Sphinx nitpicks in `inspect.rst` (#112662)Alex Waygood2023-12-035-9/+19
|
* Fix link to 'The Perils of Floating Point', on the tutorial (GH-112499)Marco Aurélio A. Barbosa2023-12-031-1/+1
| | | Use author link to 'The Perils of Floating Point'.
* gh-112645: remove deprecation warning for use of onerror in shutil.rmtree ↵Irit Katriel2023-12-034-19/+9
| | | | (#112659)
* gh-112620: Fix dis error on show_cache with labels (#112621)Irit Katriel2023-12-032-6/+23
|
* Run more `inspect.rst` code snippets in CI (#112654)Alex Waygood2023-12-031-28/+38
|
* gh-111545: Mention PEP 456 in PyHash_GetFuncDef() doc (#112647)Victor Stinner2023-12-031-0/+3
|
* gh-106560: Fix redundant declarations in Python/frozen.c (#112612)Victor Stinner2023-12-032-7/+12
| | | | | | Avoid duplicated declarations of "extern" functions in Python/frozen.c. Compiler warnings seen by building Python with gcc -Wredundant-decls.
* gh-106560: Fix redundant declarations in Include/ (#112611)Victor Stinner2023-12-034-6/+4
| | | | | | Don't declare PyBool_Type, PyLong_Type and PySys_Audit() twice, but only once. Compiler warnings seen by building Python with gcc -Wredundant-decls.
* gh-112578: Fix RuntimeWarning when running zipfile (GH-112579)Shantanu2023-12-033-77/+72
|
* gh-112316: improve docs for `inspect.signature` and `inspect.Signature` ↵Alex Waygood2023-12-032-37/+56
| | | | (#112631)
* gh-66819: More IDLE htest updates(2) (#112642)Terry Jan Reedy2023-12-039-69/+70
| | | | | Examine and update spec -- callable pairs. Revise run method.
* gh-112139: Add `inspect.Signature.format` and use it in `pydoc` (#112143)Nikita Sobolev2023-12-026-11/+205
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Docs: Use sphinx-notfound-page to show a nicer 404 page (#111084)Hugo van Kemenade2023-12-022-1/+8
|
* gh-112618: Make `Annotated` cache typed (#112619)Nikita Sobolev2023-12-023-5/+42
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-112316: Improve docs of `inspect.signature` and `Signature.from_callable` ↵Nikita Sobolev2023-12-021-19/+18
| | | | | (#112317) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-106922: Support multi-line error locations in traceback (attempt 2) (#112097)William Wen2023-12-019-127/+709
|
* gh-112567: Add _PyTimeFraction C API (#112568)Victor Stinner2023-12-013-107/+130
| | | | | | | | | | | | | | | | | | | | | Use a fraction internally in the _PyTime API to reduce the risk of integer overflow: simplify the fraction using Greatest Common Divisor (GCD). The fraction API is used by time functions: perf_counter(), monotonic() and process_time(). For example, QueryPerformanceFrequency() usually returns 10 MHz on Windows 10 and newer. The fraction SEC_TO_NS / frequency = 1_000_000_000 / 10_000_000 can be simplified to 100 / 1. * Add _PyTimeFraction type. * Add functions: * _PyTimeFraction_Set() * _PyTimeFraction_Mul() * _PyTimeFraction_Resolution() * No longer check "numer * denom <= _PyTime_MAX" in _PyTimeFraction_Set(). _PyTimeFraction_Mul() uses _PyTime_Mul() which handles integer overflow.
* gh-112567: Add _Py_GetTicksPerSecond() function (#112587)Victor Stinner2023-12-019-125/+142
| | | | | | | | | | * Move _PyRuntimeState.time to _posixstate.ticks_per_second and time_module_state.ticks_per_second. * Add time_module_state.clocks_per_second. * Rename _PyTime_GetClockWithInfo() to py_clock(). * Rename _PyTime_GetProcessTimeWithInfo() to py_process_time(). * Add process_time_times() helper function, called by py_process_time(). * os.times() is now always built: no longer rely on HAVE_TIMES.
* gh-110481: Fix typo in Py_SET_REFCNT() (#112595)Victor Stinner2023-12-011-3/+3
|
* bpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503)Zackery Spytz2023-12-013-5/+27
| | | | | * Fix a crash when pass UINT_MAX. * Fix an integer overflow on 64-bit non-Windows platforms.
* gh-109413: libregrtest: enable mypy's `--strict-optional` check on most ↵Alex Waygood2023-12-014-5/+16
| | | | | files (#112586) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-110481: Fix Py_SET_REFCNT() integer overflow (#112174)Victor Stinner2023-12-013-10/+26
| | | | | | | | | | | | | | If Py_NOGIL is defined and Py_SET_REFCNT() is called with a reference count larger than UINT32_MAX, make the object immortal. Set _Py_IMMORTAL_REFCNT constant type to Py_ssize_t to fix the following compiler warning: Include/internal/pycore_global_objects_fini_generated.h:14:24: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and 'unsigned int' [-Wsign-compare] if (Py_REFCNT(obj) < _Py_IMMORTAL_REFCNT) { ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
* gh-112510: Add `readline.backend` for the backend readline uses (GH-112511)Tian Gao2023-12-016-12/+27
| | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Donghee Na <donghee.na92@gmail.com>